1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 template<class T
> struct A
{
4 template<class U
> struct C
{ };
6 template<> struct A
<int> {
13 // A<int>::f must be defined somewhere
14 // template<> not used for a member of an // explicitly specialized class template
15 void A
<int>::f(int) { /* ... */ }
16 template<> struct A
<char>::B
{
19 // template<> also not used when defining a member of // an explicitly specialized member class
20 void A
<char>::B::f() { /* ... */ }
21 template<> template<class U
> struct A
<char>::C
{
26 template<class U
> void A
<char>::C
<U
>::f() { /* ... */ }
27 template<> struct A
<short>::B
{
30 template<> void A
<short>::B::f() { /* ... */ } // expected-error{{no function template matches function template specialization 'f'}}
31 template<> template<class U
> struct A
<short>::C
{
34 template<class U
> void A
<short>::C
<U
>::f() { /* ... */ } // expected-error{{template parameter list matching the non-templated nested type 'A<short>' should be empty ('template<>')}}