[clang] Include [[clang::require_explicit_initialization]] warnings in system headers (PR #141133)

via cfe-commits cfe-commits at lists.llvm.org
Fri May 23 00:56:20 PDT 2025


cor3ntin wrote:

I've been considering similar issues recently.
e.g https://compiler-explorer.com/z/5xcKf8Kj1 

A more general solution would be to emit diagnostics in system headers if one of the involved types/expressions names an entity declared outside of a system header.
I haven't had a brilliant idea on how to do that yet. Note that looking at the instantiation stack doesn't help because warnings unrelated to user code can be produced in system headers, caused by an instantiation in user code.

So we need to look at entities.... somehow.




https://github.com/llvm/llvm-project/pull/141133


More information about the cfe-commits mailing list