Created on 2002-01-10.00:00:00 last changed 243 months ago
Rationale (October, 2004):
CWG agreed that such comma expressions are and ought to be dependent, for the reason expressed in Mark Mitchell's comment.
Is the comma expression in the following dependent?
template <class T> static void f(T) { } template <class T> void g(T) { f((T::x, 0)); } struct A { static int x; }; void h() { g(A()); }
According to the standard, it is, because 13.8.3.3 [temp.dep.expr] says that an expression is dependent if any of its sub-expressions is dependent, but there is a question about whether the language should say something different. The type and value of the expression are not really dependent, and similar cases (like casting T::x to int) are not dependent.
Mark Mitchell: If the first operand is dependent, how do we know it does not have an overloaded comma operator?
History | |||
---|---|---|---|
Date | User | Action | Args |
2004-11-07 00:00:00 | admin | set | messages: + msg1107 |
2004-11-07 00:00:00 | admin | set | status: open -> nad |
2002-01-10 00:00:00 | admin | create |