blob: e78a067ef8faf3be8f9956490f7b84ec3cf0c081 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Anders Carlsson255d6412009-09-13 23:59:13 +00002template<typename T> struct A {
3 struct B { };
4
5 friend struct B;
6};
7
8void f() {
9 A<int>::B b;
10}
Douglas Gregorfc9cd612009-09-26 20:57:03 +000011
12struct C0 {
13 friend struct A<int>;
14};
Douglas Gregor57265e32010-04-12 16:00:01 +000015
16namespace PR6770 {
17 namespace N {
18 int f1(int);
19 }
20 using namespace N;
21
22 namespace M {
23 float f1(float);
24 }
25 using M::f1;
26
27 template<typename T> void f1(T, T);
28 template <class T>
29 void f() {
30 friend class f; // expected-error{{'friend' used outside of class}}
Richard Trieu2fe9b7f2011-12-15 00:38:15 +000031 friend class f1; // expected-error{{'friend' used outside of class}}
Douglas Gregor57265e32010-04-12 16:00:01 +000032 }
33}