Skip to content

Conversation

@agagniere
Copy link

@agagniere agagniere commented Mar 3, 2023

Fix compilation errors that arise when compiling with the c++20 standard.

To compile with --std=c++20, one can do:

cmake . -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_EXTENSIONS=NO

We can check that the flag is used:

$ make -j `nproc` VERBOSE=1
... -fPIC -std=c++20 ...

Tested with gcc 9.5.0 and gcc 12.1.0 on ubuntu 22.04

@agagniere
Copy link
Author

agagniere commented Mar 5, 2023

Tested on MacOS with Apple clang 14.
However for the compilation not to fail (unrelated to this PR), one needs to use the flag --std=gnu++20, id est:

cmake . -DCMAKE_CXX_STANDARD=20 # (implied:) -DCMAKE_CXX_EXTENSIONS=YES

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 this pull request may close these issues.

1 participant