]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/SemaTemplate/injected-class-name.cpp
Update clang to r84119.
[FreeBSD/FreeBSD.git] / test / SemaTemplate / injected-class-name.cpp
1 // RUN: clang-cc -fsyntax-only -verify %s
2 template<typename T>
3 struct X {
4   X<T*> *ptr;
5 };
6
7 X<int> x;
8
9 template<>
10 struct X<int***> {
11   typedef X<int***> *ptr;
12 };
13
14 // FIXME: EDG rejects this in their strict-conformance mode, but I
15 // 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?"
18 X<float>::X<int> xi = x;
19
20 // [temp.local]p1:
21
22 // FIXME: test template template parameters
23 template<typename T, typename U>
24 struct 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 };
41
42 template<typename T, T N>
43 struct 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