Created on 2010-09-05.00:00:00 last changed 131 months ago
[Voted into the WP at the March, 2011 meeting as part of paper N3277.]
Proposed resolution (November, 2010):
Change 6.8 [basic.types] paragraph 10 as follows:
A type is a literal type if it is:
a scalar type; or
a reference type; or
...
Change 9.2.6 [dcl.constexpr] paragraph 3 as follows:
The definition of a constexpr function shall satisfy the following constraints:
it shall not be virtual (11.7.3 [class.virtual])
its return type shall be a literal type
or a reference to literal typeeach of its parameter types shall be a literal type
or a reference to literal type...
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 literal type;...
9.2.6 [dcl.constexpr] paragraph 3 is overly restrictive in requiring that reference parameter and return types of a constexpr function or constructor must refer to a literal type. 7.7 [expr.const] paragraph 2 already prevents any problematic uses of lvalues of non-literal types, and it permits use of pointers to non-literal types as address constants. The same should be permitted via reference parameters and return types of constexpr functions.
(See also issue 1194.)
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: + msg3330 |
2011-04-10 00:00:00 | admin | set | status: review -> fdis |
2010-11-29 00:00:00 | admin | set | messages: + msg3085 |
2010-11-29 00:00:00 | admin | set | status: open -> review |
2010-09-05 00:00:00 | admin | create |