Created on 2005-08-21.00:00:00 last changed 196 months ago
[Voted into the WP at the April, 2007 meeting as part of paper J16/07-0095 = WG21 N2235.]
Additional note (May, 2008):
This issue is resolved by the rewrite of 7.7 [expr.const] that was done in conjunction with the constexpr proposal, paper N2235.
Notes from April, 2006 meeting:
The proposed resolution could potentially be read as saying that the prohibited operations and operators would be permitted in integral constant expressions that are non-type template-arguments. John Spicer is investigating an alternate approach, to say that expressions in non-type template arguments are not part of the expression in which the template-id appears (in contrast to the operand of sizeof, which is part of the containing expression).
Proposed resolution (October, 2005):
Change the last sentence of 7.7 [expr.const] paragraph 1 as indicated:
In particular, except in non-type template-arguments or sizeof expressions, functions, class objects, pointers, or references shall not be used, and assignment, increment, decrement, function-call, or comma operators shall not be used.
(Note: the same text is changed by the resolution of issue 367.)
Consider:
template <int* p> struct S { static const int I = 3; }; int i; int a[S<&i>::I];
Clearly this should be valid, but a pedantic reading of 7.7 [expr.const] would suggest that this is invalid because “&i” is not permitted in integral constant expressions.
History | |||
---|---|---|---|
Date | User | Action | Args |
2008-10-05 00:00:00 | admin | set | status: wp -> cd1 |
2008-05-18 00:00:00 | admin | set | messages: + msg1673 |
2008-05-18 00:00:00 | admin | set | messages: + msg1672 |
2008-05-18 00:00:00 | admin | set | status: drafting -> wp |
2006-04-22 00:00:00 | admin | set | messages: + msg1330 |
2006-04-22 00:00:00 | admin | set | status: ready -> drafting |
2005-10-22 00:00:00 | admin | set | messages: + msg1219 |
2005-08-21 00:00:00 | admin | create |