Anders Carlsson | 3881170 | 2009-05-11 22:55:49 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
| 2 | |
| 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}} |
John McCall | 2b058ef | 2009-12-11 20:04:54 +0000 | [diff] [blame^] | 7 | |
| 8 | // PR5760 |
| 9 | namespace test0 { |
| 10 | namespace ns { |
| 11 | void f(int); |
| 12 | } |
| 13 | |
| 14 | struct A { |
| 15 | friend void ns::f(int a); |
| 16 | }; |
| 17 | } |