1 // RUN: %clang_cc1 -fsyntax-only -verify %s
12 friend int x; // expected-error {{'friend' used outside of class}}
14 friend class D {}; // expected-error {{'friend' used outside of class}}
21 // 'A' here should refer to the declaration above.
24 friend C; // expected-warning {{specify 'class' to befriend}}
25 friend U; // expected-warning {{specify 'union' to befriend}}
26 friend int; // expected-warning {{non-class friend type 'int'}}
30 void f(A *a) { a->f(); }
33 inline void bar() {} // expected-note {{previous definition is here}}
35 friend void bar() {} // expected-error {{redefinition of 'bar'}}
41 template <typename t1, typename t2> class some_template;
42 friend // expected-error {{'friend' used outside of class}}
43 some_template<foo, bar>& // expected-error {{use of undeclared identifier 'foo'}}
44 ; // expected-error {{expected unqualified-id}}