Created on 2011-10-21.00:00:00 last changed 156 months ago
Rationale (February, 2012):
The analysis is correct, and the example is ill-formed. Implementations that accept it are in error.
The following example appears to be ill-formed, although current implementations accept it:
template<bool> struct S { }; S<0> s;
The reason this is ill-formed is that the non-type template argument is a converted constant expression of type bool (see 13.4.3 [temp.arg.nontype] paragraph 5), and the second conversion in the implicit conversion sequence is a boolean conversion, which is not allowed in the conversion for a converted constant expression (see 7.7 [expr.const] paragraph 3) . Conversions in the other direction (from bool to integer types) are permitted here, since they're integral promotions.
History | |||
---|---|---|---|
Date | User | Action | Args |
2012-02-27 00:00:00 | admin | set | messages: + msg3843 |
2012-02-27 00:00:00 | admin | set | status: open -> nad |
2011-10-21 00:00:00 | admin | create |