Bug 574854 - parser fails on std::abs(std::complex)
Summary: parser fails on std::abs(std::complex)
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 10.3.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-15 04:18 EDT by Axel Mueller CLA
Modified: 2021-07-15 11:34 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Axel Mueller CLA 2021-07-15 04:18:59 EDT
The indexer fails on std::abs if the argument is a std::complex type.

#include <algorithm>
#include <cmath>
#include <complex>

int main() {
  float a = 1.0f, b = 2.0f;
  float c = 3.0f, d = 4.0f;

  {
    auto mag1 = std::abs(a);
    auto mag2 = std::abs(b);
    const auto min = std::min(mag1, mag2);
  }

  {
    auto mag1 = std::abs(std::complex(a, b));  // indexer: invalid arguments
    auto mag2 = std::abs(std::complex(c, d));  // indexer: invalid arguments
    auto min = std::min(mag1, mag2);           // indexer: invalid arguments
  }
}


Environment: Linux with g++ 9.3
Comment 1 Axel Mueller CLA 2021-07-15 11:34:19 EDT
I guess the problem is not the indexer but the parser.