[clang] Include [[clang::require_explicit_initialization]] warnings in system headers (PR #141133)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed May 28 11:06:50 PDT 2025
erichkeane wrote:
> @erichkeane the question of whether `S s{}; s.f = ...;` should be deemed as a relaxation of `S s{.f = ...};` came up during the initial RFC. From memory, the conclusion was that it's something we could relax in a v2 of the RFC, but it is a _significant_ amount of work, and the initial design shouldn't be blocked on it. Furthermore, we haven't really seen significant demand for that on our side. By contrast, the current bug is actually a loophole in the original design that is causing bugs to slip through for current users who only needed the guarantees from the original attribute, so blocking this on that doesn't really feel justified at this stage.
Its more that we assume/like to assume that the Standard Library always 'does the right thing', even if it does so in ways that look 'wrong'. So we suppress warnings in the standard library headers, since they are assumed to all be false-positives.
This of course is an interesting 'that assumption is not perfectly true' anymore type of situation.
> Could I move forward with merging this? Or does anyone feel there are blockers here?
@AaronBallman , @cor3ntin , and need to discuss this still I think and make sure we are sure. Unfortunately Aaron's next 'office hours' (when we'd do this typically) aren't for a few weeks, but I'll see if we can discuss this offline in the near future.
https://github.com/llvm/llvm-project/pull/141133
More information about the cfe-commits
mailing list