blob: 482eae14ba596ad831f4773cfb21c2752c8aa988 [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// RUN: %clang_cc1 -fsyntax-only -verify %s
2template<typename T>
3struct X {
4 X<T*> *ptr;
5};
6
7X<int> x;
8
9template<>
10struct X<int***> {
11 typedef X<int***> *ptr;
12};
13
14X<float>::X<int> xi = x; // expected-error{{qualified reference to 'X' is a constructor name rather than a template name wherever a constructor can be declared}}
15
16// [temp.local]p1:
17
18// FIXME: test template template parameters
19template<typename T, typename U>
20struct X0 {
21 typedef T type;
22 typedef U U_type;
23 typedef U_type U_type2;
24
25 void f0(const X0&); // expected-note{{here}}
26 void f0(X0&);
27 void f0(const X0<T, U>&); // expected-error{{redecl}}
28
29 void f1(const X0&); // expected-note{{here}}
30 void f1(X0&);
31 void f1(const X0<type, U_type2>&); // expected-error{{redecl}}
32
33 void f2(const X0&); // expected-note{{here}}
34 void f2(X0&);
35 void f2(const ::X0<type, U_type2>&); // expected-error{{redecl}}
36};
37
38template<typename T, T N>
39struct X1 {
40 void f0(const X1&); // expected-note{{here}}
41 void f0(X1&);
42 void f0(const X1<T, N>&); // expected-error{{redecl}}
43};
44