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

Error: on macOS with gcc-14: "non-constant condition for static assertion" #47

Open
ClausKlein opened this issue Dec 6, 2024 · 0 comments

Comments

@ClausKlein
Copy link
Contributor

/Users/clausklein/Workspace/cpp/beman-project/inplace_vector/tests/beman/inplace_vector/ref_impl.test.cpp:332:17: error: non-constant condition for static assertion
  332 |   static_assert(ct, "CONSTEXPR TESTS FAILED");
      |                 ^~
/Users/clausklein/Workspace/cpp/beman-project/inplace_vector/tests/beman/inplace_vector/ref_impl.test.cpp: In instantiation of 'void test_all() [with T = int; long unsigned int N = 10]':
/Users/clausklein/Workspace/cpp/beman-project/inplace_vector/tests/beman/inplace_vector/ref_impl.test.cpp:352:20:   required from here
  352 |   test_all<int, 10>();
      |   ~~~~~~~~~~~~~~~~~^~
/Users/clausklein/Workspace/cpp/beman-project/inplace_vector/tests/beman/inplace_vector/ref_impl.test.cpp:331:38: error: 'constexpr bool test_all_() [with T = int; long unsigned int N = 10]' called in a constant expression
  331 |   constexpr bool ct = test_all_<T, N>();
      |                       ~~~~~~~~~~~~~~~^~
/Users/clausklein/Workspace/cpp/beman-project/inplace_vector/tests/beman/inplace_vector/ref_impl.test.cpp:319:53: note: 'constexpr bool test_all_() [with T = int; long unsigned int N = 10]' is not usable as a 'constexpr' function because:
  319 | template <typename T, std::size_t N> constexpr bool test_all_() {
      |                                                     ^~~~~~~~~
/Users/clausklein/Workspace/cpp/beman-project/inplace_vector/tests/beman/inplace_vector/ref_impl.test.cpp:332:17: error: non-constant condition for static assertion
  332 |   static_assert(ct, "CONSTEXPR TESTS FAILED");
      |                 ^~
ninja: build stopped: subcommand failed.
bash-5.2$ CXX=gcc-14 LDFLAGS= cmake -G Ninja -S . -B build -DCMAKE_CXX_STANDARD=23 --fresh 
-- The CXX compiler identification is GNU 14.2.0
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/gcc-14 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Examples to be built: fibonacci
-- Configuring done (2.4s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/clausklein/Workspace/cpp/beman-project/inplace_vector/build
bash-5.2$ builddriver ninja -C build
builddriver executing: 'ninja -C build'
Compilation FAILED in 1.805541 seconds
Number of warnings: 0
Number of errors: 1006
Last Error:
  Message: "non-constant condition for static assertion"
  Path: /Users/clausklein/Workspace/cpp/beman-project/inplace_vector/tests/beman/inplace_vector/ref_impl.test.cpp
  Line Number: 332
  Column: 17
For full log, please open: /var/folders/wb/ckvxxgls5db7qyhqq4y5_l1c0000gq/T/build-bbaivtne.log
bash-5.2$ 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants