blob: f9674c39a58b9cb1ec0b164ec7cd4b782421aef5 [file] [log] [blame]
Douglas Gregorbefc20e2009-03-26 00:10:35 +00001// RUN: clang-cc -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
14// FIXME: EDG rejects this in their strict-conformance mode, but I
Douglas Gregor7da97d02009-05-10 22:57:19 +000015// don't see any wording making this ill-formed. Actually,
16// [temp.local]p2 might make it ill-formed. Are we "in the scope of
17// the class template specialization?"
Douglas Gregorbefc20e2009-03-26 00:10:35 +000018X<float>::X<int> xi = x;
Douglas Gregor7da97d02009-05-10 22:57:19 +000019
20// [temp.local]p1:
21
Douglas Gregor828e2262009-07-29 16:09:57 +000022// FIXME: test template template parameters
Douglas Gregor7da97d02009-05-10 22:57:19 +000023template<typename T, typename U>
24struct X0 {
25 typedef T type;
26 typedef U U_type;
27 typedef U_type U_type2;
28
29 void f0(const X0&); // expected-note{{here}}
30 void f0(X0&);
31 void f0(const X0<T, U>&); // expected-error{{redecl}}
32
33 void f1(const X0&); // expected-note{{here}}
34 void f1(X0&);
35 void f1(const X0<type, U_type2>&); // expected-error{{redecl}}
36
37 void f2(const X0&); // expected-note{{here}}
38 void f2(X0&);
39 void f2(const ::X0<type, U_type2>&); // expected-error{{redecl}}
40};
Douglas Gregor828e2262009-07-29 16:09:57 +000041
42template<typename T, T N>
43struct X1 {
44 void f0(const X1&); // expected-note{{here}}
45 void f0(X1&);
46 void f0(const X1<T, N>&); // expected-error{{redecl}}
47};
48