[clang] [clang] Do not serialize function definitions without a body (PR #121550)
Chuanqi Xu via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 6 00:07:47 PST 2025
ChuanqiXu9 wrote:
> > Out of curiosity (not a blocking issue), why do you want this feature for C++20 modules?
>
> Sanitizers, linters and indexers have to deal with code using non supported C++ language features or extensions. This is also true for C++20 modules. While conceivably one may implement module support without going through the intermediate PCM, to keep the semantics close to what the compiler does, the most straightforward is to do what the compiler does and go throught the same codepath as when actually compiling 😃 And also, they would be able to not having to reparse everything and leverage one of the benefits of C++20 modules.
Just to make sure I understand things correctly, you're saying:
```
// some.cc
import mod;
...
```
You hope the linter doesn't give up `some.cc` if `mod` contains some errors? If yes, that makes sense to me.
But why Sanitizers? IIRC, they should only work if the project compiles. Or are you saying the static analyzer?
https://github.com/llvm/llvm-project/pull/121550
More information about the cfe-commits
mailing list