[temp.alias]

13 Templates [temp]

13.7 Template declarations [temp.decls]

13.7.8 Alias templates [temp.alias]

An alias template is a name for a family of types.

Any other template-id that names a specialization of an alias template is a typedef-name for a type alias; such a template-id is ill-formed if forming the associated type results in substitution failure.

[Note 1:

The alias template name is not deduced from such a type ([temp.deduct.type]).

— end note]

[Example 1: template<class T> struct Alloc { }; template<class T> using Vec = vector<T, Alloc<T>>; Vec<int> v; template<class T> void process(Vec<T>& v) { } template<class T> void process(vector<T, Alloc<T>>& w) { } template<template<class> class TT> void f(TT<int>); f(v); template<template<class,class> class TT> void g(TT<int, Alloc<int>>); g(v); — end example]

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

[Example 2: template<typename...> using void_t = void; template<typename T> void_t<typename T::foo> f(); f<int>(); — end example]

The defining-type-id in an alias template declaration shall not refer to the alias template being declared.

The type produced by an alias template specialization shall not directly or indirectly make use of that specialization.

[Example 3: template <class T> struct A; template <class T> using B = typename A<T>::U; template <class T> struct A { typedef B<T> U; }; B<short> b; — end example]

The type of a lambda-expression appearing in an alias template declaration is different between instantiations of that template, even when the lambda-expression is not dependent.

[Example 4: template <class T> using A = decltype([] { }); — end example]