Title
Type dependence of call to a member of the current instantiation
Status
c++14
Section
13.8.3.2 [temp.dep.type]
Submitter
Richard Smith

Created on 2013-08-14.00:00:00 last changed 114 months ago

Messages

Date: 2014-02-15.00:00:00

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

Date: 2013-11-15.00:00:00

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

  • an identifier associated by name lookup with one or more declarations declared with a dependent type,

  • an identifier associated by name lookup with one or more declarations of member functions of the current instantiation declared with a return type that contains a placeholder type (9.2.9.7 [dcl.spec.auto]),

  • a template-id that is dependent,

  • a conversion-function-id that specifies a dependent type, or

  • a nested-name-specifier or a qualified-id that names a member of an unknown specialization;

or if it names a dependent member...

Date: 2013-08-14.00:00:00

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.

History
Date User Action Args
2014-11-24 00:00:00adminsetstatus: dr -> c++14
2014-03-03 00:00:00adminsetmessages: + msg4967
2014-03-03 00:00:00adminsetstatus: tentatively ready -> dr
2014-01-20 00:00:00adminsetmessages: + msg4739
2014-01-20 00:00:00adminsetstatus: drafting -> tentatively ready
2013-10-14 00:00:00adminsetstatus: open -> drafting
2013-08-14 00:00:00admincreate