[clang] [clang] warn_{cstruct, cxxstruct}_memaccess are too agressive about initializers (PR #170577)
Oliver Hunt via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 4 02:15:40 PST 2025
ojhunt wrote:
> But I don't want to miss cases where a sub-object has a non trivial default constructor as in https://godbolt.org/z/aq7PosMPa.
Oh absolutely, I am not suggesting the warning be silenced if initialization is non trivial. I'm sorry if I gave that impression - that's a case where the warning is warranted.
> I can see the practical aspect of only requiring:
>
> 1. trivially default constructible type when from outside of the constructor
> 2. that the type matches all requirements for being default constructible except the requirement of a defaulted default constructor, when from the default constructor.
>
> What do you think of that approach?
In the latter do you mean "if the only reason a type is not default initializable is the constructor doing the bzero we should allow it"?
https://github.com/llvm/llvm-project/pull/170577
More information about the cfe-commits
mailing list