There is a nested template type that has a template parameter, but this is used in another templated function where the type reference is a dependent name.
template <class T1>
struct s
{
template <class T2>
struct s2
{
};
};
template <template <class> class T>
void func()
{
T<int>();
}
template <class T>
void func2()
{
func<s<T>::s2>(); //error
}
However, this yields an error:
error: dependent-name
s<T>::s2
is parsed as a non-type, but instantiation yields a type
note: saytypename s<T>::s2
if a type is meant
Adding typename
does not help though:
error:
typename s<int>::s2
namestemplate<class T2> struct s<int>::s2
, which is not a type
Neither adding template
works:
error: parse error in template argument list
func<typename s<T>::template s2>();