This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 114a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-04-18


1737. Type dependence of call to a member of the current instantiation

Section: 13.8.3.2  [temp.dep.type]     Status: C++14     Submitter: Richard Smith     Date: 2013-08-14

[Moved to DR at the February, 2014 meeting.]

Since we don't deduce the return type of a function temploid until it is instantiated, it seems that a call to such a function as a member of the current instantiation must have a dependent type, but 13.8.3.3 [temp.dep.expr] doesn't appear to say that. For example:

   template<typename T> struct X { typedef int type; };
   template<typename T> struct S {
     auto f() { return 0; }
     void g() {
       X<decltype(f())>::type x; // typename presumably needed here
     }
   }

Presumably there should be a bullet in 13.8.3.2 [temp.dep.type] paragraph 8 for this case.

Proposed resolution (November, 2013):

Change 13.8.3.3 [temp.dep.expr] paragraph 3 as follows:

An id-expression is type-dependent if it contains

or if it names a dependent member...