Created on 2011-12-24.00:00:00 last changed 58 months ago
Rationale (February, 2021):
The adoption of paper P1331R2 (at the July, 2019 meeting) rendered the question in the issue moot, as the requirement that a constexpr constructor initialize all its non-static data members was removed, so the defaulted B default constructor is now constexpr.
Additional note (February, 2017):
This is effectively issue 644, which was resolved once, then had its resolution backed out via the resolution of issue 1071 (actual drafting in issue 981).
Some classes that would produce a constant when initialized by value-initialization are not considered literal types. For example:
struct A { int a; }; // non-constexpr default constructor
struct B : A {}; // non-literal type
constexpr int i = B().a; // OK, trivial constructor not called
constexpr B b = b (); // error, constexpr object of non-literal type
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2021-02-17 00:00:00 | admin | set | messages: + msg6508 |
| 2021-02-17 00:00:00 | admin | set | status: drafting -> nad |
| 2018-02-27 00:00:00 | admin | set | messages: + msg5900 |
| 2011-12-24 00:00:00 | admin | create | |