2

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.

JasonN
  • 1,339
  • 1
  • 15
  • 27

1 Answers1

4

You can add:

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

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

For more details, see:

HighCommander4
  • 50,428
  • 24
  • 122
  • 194
  • This doesn't b seem to handle to case where ther is no entry into the compilation database. eg, hasb't been a compilation since introduced. Can't use the compile flags alternate either because that blocks the compile database for the rest. – JasonN Sep 11 '22 at 23:36
  • @JasonN As far as I know, `CompileFlags` should be respected even if there is no `compile_commands.json` present. To diagnose the issue further, could you share [clangd logs](https://clangd.llvm.org/troubleshooting#gathering-logs)? – HighCommander4 Sep 12 '22 at 03:04