This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-11-05
[Adopted at the February, 2016 meeting.]
Consider the following example:
template<int> struct X { typedef int type; }; template<typename T> struct Y { void f() { X<false ? this - this : 0>::type x; } // missingtypename? }; void g() { Y<void>().f(); }This appears to be valid because the template argument expression isnot value-dependent.
Until I discovered this, I had been assuming that anytype-dependent expression is also value-dependent. The onlyexception to that appears to be the expressionthis, whichmay be type-dependent but is never value-dependent.
Now,this need not ever be value-dependent, becauseevaluation of it will never succeed when it appears as asubexpression of an expression that we're checking forconstant-expression-ness. But if that's really what we wanthere, then the same applies to function parameters withdependent types, and probably a few other cases.
Proposed resolution (September, 2015) [SUPERSEDED]:
Change 13.8.3.4 [temp.dep.constexpr] paragraph 4 as follows:
Expressions of the following form are value-dependent:
sizeof ... (identifuer)
this
fold-expression
Proposed resolution (March, 2016):
This issue is resolved by the resolution ofissue 2109.