1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 friend class A; // expected-error {{'friend' used outside of class}}
4 void f() { friend class A; } // expected-error {{'friend' used outside of class}}
5 class C { friend class A; };
6 class D { void f() { friend class A; } }; // expected-error {{'friend' used outside of class}}
15 friend void ns::f(int a);
19 // Test derived from LLVM's Registry.h
21 template <class T> struct Outer {
24 friend void Outer::foo(T);
29 (void) Outer<int>::Inner();
40 friend void ::test2::foo::Func(int x);
47 friend const int getInt(int inInt = 0);