Created on 2009-05-08.00:00:00 last changed 131 months ago
[Voted into WP at August, 2010 meeting.]
Proposed resolution (February, 2010):
Change 9.2.6 [dcl.constexpr] paragraph 4 as follows:
The definition of a constexpr constructor shall satisfy the following constraints:
each of its parameter types shall be a literal type or a reference to a literal type
its function-body shall not be a function-try-block
the compound-statement of its function-body shall be empty
every non-static data member and base class sub-object shall be initialized (11.9.3 [class.base.init])
every constructor involved in initializing non-static data members and base class sub-objects
invoked by a mem-initializershall be a constexpr constructor.every constructor argument and full-expression in a mem-initializer shall be a potential constant expression
every assignment-expression that is an initializer-clause appearing directly or indirectly within a brace-or-equal-initializer for a non-static data member that is not named by a mem-initializer-id shall be a constant expression
every implicit conversion used in converting a constructor argument to the corresponding parameter type and converting a full-expression to the corresponding member type shall be one of those allowed in a constant expression.
The rules for constexpr constructors are missing some necessary requirements. In particular, there is no requirement that a brace-or-equal-initializer for a non-static data member be a constant expression, and the requirement for constexpr constructors for initializing non-static data members applies only to members named in a mem-initializer, allowing a non-constexpr default constructor to be invoked.
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 | status: wp -> fdis |
2010-11-29 00:00:00 | admin | set | status: dr -> wp |
2010-08-23 00:00:00 | admin | set | messages: + msg2913 |
2010-08-23 00:00:00 | admin | set | status: ready -> dr |
2010-03-29 00:00:00 | admin | set | status: review -> ready |
2010-02-16 00:00:00 | admin | set | messages: + msg2535 |
2010-02-16 00:00:00 | admin | set | status: drafting -> review |
2009-08-03 00:00:00 | admin | set | status: open -> drafting |
2009-05-08 00:00:00 | admin | create |