We don't yet have any intentional modules support:
https://github.com/clangd/clangd/issues/1293
However if the user has modules-related flags in their CDB, modules will still
be enabled inside clang.
- for some configurations this works well enough, apparently. We should allow them to keep using this config if they wish, though unsupported.
- for other configurations this is crashy/buggy. We can't really control the behavior/stability, so long-term this should not be the default.
- there is no flag to disable modules if when using -std=c++20. Since clangd does not support modules, we should provide a mechanism.
- in future we're likely to explicitly add modules support. This will not be a simple passthrough of flags to clang, so we'll need another mode.
This patch adds a config option:
CompileFlags: NaiveModules: false
For now, the default is true, and modules are internally enabled/disabled
according to compile flags. When set to false, we force Modules/CPlusPlusModules
lang opts off.
For existing tests of how modules interacts with other features, testing these with modules-enabled seems sufficient.
For tests that were specifically about modules, I think it makes sense to test in both modes (behavior may differ).