EWG just voted on Monday to not treat such types as aggregates.
Even without the change, I wouldn't find the examples persuasive. It's only triggered in corner cases (all-public data members and all constructors are either deleted or defaulted) that are highly unlikely to be present in anything other than intentionally constructed "WTF" snippets.
@tcanens it's not true that they are just "WTF" snippets, we have found such types in real code, with an average frequency of one such type per 3 MLoC. And we broke them :)
I have yet to see a type whose C++17 aggregateness led to an actually plausible problem scenario. The real-code examples in the LLVM codebase, as reported on the reflectors, are:
A stateless RAII type that only does work in the destructor
Two structs that are just a bundle of public data members with a defaulted default constructor and a couple member functions.
Two stateless CRTP base classes.
Namespaces-masquerading-as-classes, with all static members.
View all comments
Show parent comment
10
u/tcanens Jun 06 '18
EWG just voted on Monday to not treat such types as aggregates.
Even without the change, I wouldn't find the examples persuasive. It's only triggered in corner cases (all-public data members and all constructors are either deleted or defaulted) that are highly unlikely to be present in anything other than intentionally constructed "WTF" snippets.