[clang] [C++26][clang] Implement P2795R5 'Erroneous behaviour for uninitialized reads' (PR #177614)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 15 09:13:14 PDT 2026
yronglin wrote:
I reverted the extra hard error that based on static analyze. It's a bit redundant with `-Winitialized`.
> We should diagnose at runtime somehow.
Yeah, I agree. A runtime diagnose like msan more make sense.
> Then there is the question of whether we want to force more instrumentation in clang somehow - although that is probably premature.
Perhaps we could try adding a llvm pass to insert a `trap` or `unreachable` instruction when reading erroneous values; however, I'm not sure if this is the correct approach.
> Sanitizers should know about indeterminate and erroneous behavior (but we already diagnose reading indeterminate value in memsan).
Yeah, msan supports this feature, but we cannot enable the sanitizer by default.
https://github.com/llvm/llvm-project/pull/177614
More information about the cfe-commits
mailing list