When there is no other information, how can I get clangd to fallback to c++20? eg, before the first build and cmake can generate one. This is on Arch Linux with a recent LLVM. This is run though the Emacs LSP, but that shouldn't make a difference.

1

Best Answer


You can add:

CompileFlags:Add: [-std=c++20]

to either a project-specific or user-level clangd config file.

For more details, see:

  • https://clangd.llvm.org/config.html#files
  • https://clangd.llvm.org/config.html#add