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

2024-12-19


2462. Problems with the omission of the typename keyword

Section: 13.8.1  [temp.res.general]     Status: drafting     Submitter: Mark Hall     Date: 2020-12-03

According to 13.8.2 [temp.local] paragraph 5,

A qualified-id is assumed to name a type if

There are two possible problems with this specification. First, consider an example like

   template<typename T> struct S {
     static void (*pfunc)(T::name);                               // Omitted typename okay because it is a
                                                                  // member-declaration
   };
   template<typename T> void (*S<T>::pfunc)(T::name) = nullptr;   // Omitted typename ill-formed because not a function
                                                                  // or function template declaration

Should bullet 5.2.4 be extended to include function pointer and member function pointer declarations, as well as function and function template declarations?

Second, given an example like

   template<typename T> struct Y {};
   template<typename T> struct S {
     Y<int(T::type)> m;  // Omitted typename okay because it is in a member-declaration?
  };

Should bullet 5.2.3 be restricted to parameter-declarations of the member being declared, rather than simply “in” such a member-declaration?

Notes from the December, 2020 teleconference:

The second issue was split off into issue 2468 to allow the resolutions to proceed independently.