This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112e. See for the official list.


1558. Unused arguments in alias template specializations

Section: 13.7.8  [temp.alias]     Status: CD4     Submitter: Nikolay Ivchenkov     Date: 2012-09-19

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

The treatment of unused arguments in an alias template specialization is not specified by the current wording of 13.7.8 [temp.alias]. For example:

  #include <iostream>

  template <class T, class...>
    using first_of = T;

  template <class T>
    first_of<void, typename T::type> f(int)
      { std::cout << "1\n"; }

  template <class T>
    void f(...)
      { std::cout << "2\n"; }

  struct X { typedef void type; };

  int main() {

Is the reference to first_of<void, T::type> with T being int equivalent to simply void, or is it a substitution failure?

(See also issues 1430, 1520, and 1554.)

Notes from the October, 2012 meeting:

The consensus of CWG was to treat this case as substitution failure.

Proposed resolution (February, 2014):

Add the following as a new paragraph before 13.7.8 [temp.alias] paragraph 3:

When a template-id refers to the specialization of an alias template, it is equivalent...

However, if the template-id is dependent, subsequent template argument substitution still applies to the template-id. [Example:

  template<typename...> using void_t = void;
  template<typename T> void_t<typename T::foo> f();
  f<int>(); // error, int does not have a nested type foo

end example]

The type-id in an alias template declaration shall not refer...