blob: 482eae14ba596ad831f4773cfb21c2752c8aa988 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Douglas Gregorbefc20e2009-03-26 00:10:35 +00002template<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
Douglas Gregor0efc2c12010-01-13 17:31:36 +000014X<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}}
Douglas Gregor7da97d02009-05-10 22:57:19 +000015
16// [temp.local]p1:
17
Douglas Gregor828e2262009-07-29 16:09:57 +000018// FIXME: test template template parameters
Douglas Gregor7da97d02009-05-10 22:57:19 +000019template<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};
Douglas Gregor828e2262009-07-29 16:09:57 +000037
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