Closed xsun2001 closed 4 years ago
~Do you have CMake in version 3.8 or later? Earlier versions of CMake do not recognize 17
as a valid value for CMAKE_CXX_STANDARD
and silently fall back to whatever is the default.~
Nevermind, if that was the problem, the compilation error would be a different one. The problem here is that whatever stdlib you are using does not provide std::uncaught_exceptions
in C++17 mode. You can force Catch to fallback to std::uncaught_exception
by defining CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS
.
Thanks, I had the same issue and this fixed it!
ClangTidy doesn't like it though.
https://travis-ci.org/acgetchell/CDT-plusplus/builds/420808766
@acgetchell To me it seems less like ClangTidy doesn't work with the define and more like your compilation database is broken:
[0K$ git diff -U0 HEAD^ | /usr/lib/llvm-6.0/share/clang/clang-tidy-diff.py > output.txt
Error while trying to load a compilation database:
Could not auto-detect compilation database for file "b/tests/main.cpp"
No compilation database found in /home/travis/build/acgetchell/CDT-plusplus/b/tests or any parent directory
json-compilation-database: Error while opening JSON database: No such file or directory
Running without flags.
Error reading configuration from /home/travis/build/acgetchell/CDT-plusplus/b/tests: directory doesn't exist.
Error reading configuration from /home/travis/build/acgetchell/CDT-plusplus/b: directory doesn't exist.
1 error generated.
Error while processing /home/travis/build/acgetchell/CDT-plusplus/b/tests/main.cpp.
Should be fixed, just as #1218.
Description
Build failed after I changed
set(CMAKE_CXX_STANDARD 14)
toset(CMAKE_CXX_STANDARD 17)
.Steps to reproduce
Extra information