blob: 9a483aeb5b1e8ba9b2fc6147ad7bbe8fe0fb2106 [file] [log] [blame]
Douglas Gregor182ddf02009-09-28 00:08:27 +00001// RUN: clang-cc -fsyntax-only -verify %s
Douglas Gregord85bea22009-09-26 06:47:28 +00002
3// PR5057
4namespace std {
5 class X {
6 public:
7 template<typename T>
8 friend struct Y;
9 };
10}
11
12namespace std {
13 template<typename T>
14 struct Y
15 {
16 };
17}
Douglas Gregor182ddf02009-09-28 00:08:27 +000018
19
20namespace N {
21 template<typename T> void f1(T) { } // expected-note{{here}}
22
23 class X {
24 template<typename T> friend void f0(T);
25 template<typename T> friend void f1(T);
26 };
27
28 template<typename T> void f0(T) { }
29 template<typename T> void f1(T) { } // expected-error{{redefinition}}
30}
Douglas Gregord7e5bdb2009-10-09 21:11:42 +000031
32// PR4768
33template<typename T>
34struct X0 {
35 template<typename U> friend struct X0;
36};
37
38template<typename T>
39struct X0<T*> {
40 template<typename U> friend struct X0;
41};
42
43template<>
44struct X0<int> {
45 template<typename U> friend struct X0;
46};