clang++: Same story, as expected (I only used options in compile_commands.json that both compilers support). I found a way to eliminate the editor from the equation: clangd --check=takes_string_view.cpp Output of that on openSUSE Leap 15.4: I[19:42:18.098] clangd version 13.0.1 I[19:42:18.099] Features: linux I[19:42:18.099] PID: 19436 I[19:42:18.099] Working directory: /tmp I[19:42:18.099] argv[0]: clangd I[19:42:18.099] argv[1]: --log=info I[19:42:18.099] argv[2]: --check=takes_string_view.cpp I[19:42:18.099] Entering check mode (no LSP server) I[19:42:18.099] Testing on source file /tmp/takes_string_view.cpp I[19:42:18.099] Loading compilation database... I[19:42:18.099] Loaded compilation database from /tmp/compile_commands.json I[19:42:18.100] Compile command from CDB is: /usr/bin/clang++ --driver-mode=g++ -Iweird_include -c -resource-dir=/usr/lib64/clang/13.0.1 -- /tmp/takes_string_view.cpp I[19:42:18.100] Parsing command... I[19:42:18.101] internal (cc1) args are: -cc1 -triple x86_64-suse-linux-gnu -fsyntax-only -disable-free -disable-llvm-verifier -discard-value-names -main-file-name takes_string_view.cpp -mrelocation-model static -mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/tmp -resource-dir /usr/lib64/clang/13.0.1 -I weird_include -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/7/../../../../include/c++/7 -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/7/../../../../include/c++/7/x86_64-suse-linux -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/7/../../../../include/c++/7/backward -internal-isystem /usr/lib64/clang/13.0.1/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir=/tmp -ferror-limit 19 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c++ /tmp/takes_string_view.cpp I[19:42:18.101] Building preamble... I[19:42:18.250] Indexing headers... I[19:42:18.325] Building AST... E[19:42:18.344] [typename_nested_not_found] Line 7: no type named 'string_view' in namespace 'std' I[19:42:18.344] Indexing AST... I[19:42:18.345] Testing features at each token (may be slow in large files) I[19:42:18.347] All checks completed, 1 errors --log=info is apparently the default (gives the same output). The verbose log is more verbose, but doesn't add more clues that I can see. What I see is that -std=c++17 looks suspiciously absent in those internal args. Indeed, I can reproduce the error by running clang++ with those arguments, and then make it go away by adding -std=c++17! I think I found the missing argument! Dunno how to fix it though.