Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non constexpr expressions in tests #63

Closed
rbberger opened this issue Nov 14, 2024 · 0 comments · Fixed by #64
Closed

Non constexpr expressions in tests #63

rbberger opened this issue Nov 14, 2024 · 0 comments · Fixed by #64

Comments

@rbberger
Copy link
Collaborator

rbberger commented Nov 14, 2024

Tests fail to compile due to non-constexpr parts:

[ 85%] Building CXX object test/CMakeFiles/test_portsofcall.dir/test_static_vector.cpp.o
oss/ports-of-call/test/test_span.cpp:567:24: error: constexpr variable 'pi' must be initialized by a constant expression
  567 |   constexpr const Real pi = std::acos(-1);
      |                        ^    ~~~~~~~~~~~~~
/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/cmath:100:14: note: subexpression not valid in a constant expression
  100 |     { return __builtin_acos(__x); }
      |              ^
oss/ports-of-call/test/test_span.cpp:567:29: note: in call to 'acos(-1)'
  567 |   constexpr const Real pi = std::acos(-1);
oss/ports-of-call/test/test_span.cpp:569:18: error: constexpr variable 'd_gp' must be initialized by a constant expression
  569 |   constexpr Real d_gp = 2. * pi / static_cast<Real>(N);
      |                  ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
oss/ports-of-call/test/test_span.cpp:569:30: note: initializer of 'pi' is not a constant expression
  569 |   constexpr Real d_gp = 2. * pi / static_cast<Real>(N);
      |                              ^
oss/ports-of-call/test/test_span.cpp:567:24: note: declared here
  567 |   constexpr const Real pi = std::acos(-1);
      |                        ^
2 errors generated when compiling for gfx942.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant