Created on 2010-08-03.00:00:00 last changed 130 months ago
[Voted into the WP at the March, 2011 meeting.]
Proposed resolution (November, 2010):
This issue is resolved by the resolution of issue 1135.
Rationale (August, 2010):
The consensus of the CWG was that this change should not be made at this point in the standardization process, but that it might be considered at a later date.
What effect does defaulting have on triviality? Related to issue 1135, non-public special members defaulted on their first declaration should retain triviality, because they shouldn't be considered user-provided. Related to issue 1137, defaulted member functions that are virtual should not be considered trivial, but there's no reason why non-virtuals could not be.
Furthermore, a class with a non-public explicitly-defaulted constructor isn't ever trivially constructible under the current rules. If such a class is used as a subobject, the constructor of the aggregating class should be trivial if it can access the non-public explicitly defaulted constructor of a subobject.
Suggested resolution: Change the triviality rules so that a class can have a trivial default constructor if the class has access to the default constructors of its subobjects and the default constructors of the subobjects are explicitly defaulted on first declaration, even if said defaulted constructors are non-public.
See also issue 1149.
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-03-03 00:00:00 | admin | set | status: fdis -> c++11 |
2011-04-10 00:00:00 | admin | set | messages: + msg3361 |
2011-04-10 00:00:00 | admin | set | status: ready -> fdis |
2010-11-29 00:00:00 | admin | set | messages: + msg3058 |
2010-11-29 00:00:00 | admin | set | status: extension -> ready |
2010-08-23 00:00:00 | admin | set | messages: + msg2965 |
2010-08-03 00:00:00 | admin | create |