Issue 61576
Summary scan-build with gcc/clang mismatching default c++std
Labels new issue
Assignees
Reporter nlitsme
    When both clang and gcc are installed, in my case, clang(14) defaults to c++14, and gcc(12.2) defaults to c++17.

And the default compiler is gcc.

You may get unexplained compiler errors in your scan-build output. 
This is because scan-build does not automatically add an explicit `-std=c++17` to the clang compiler command-line it uses internally.

I ran into this problem with a cmake based project.  cmake omits unnecessary compiler flags depending on your compiler version. You can of course add the `-std=...` option explicitly, but that does not make the project files any prettier.

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to