1a5728872c7702ddd09537c95bc3cbd20e1f2fb09Daniel Dunbar// RUN: %clang_cc1 -fsyntax-only -verify %s
267d1a67f3db2f1aa69083c5c94164d6e0ee05b32John McCall
3d85bea2affdd59d83d1be7d24b97f436484c3625Douglas Gregorstruct B0;
4d85bea2affdd59d83d1be7d24b97f436484c3625Douglas Gregor
567d1a67f3db2f1aa69083c5c94164d6e0ee05b32John McCallclass A {
667d1a67f3db2f1aa69083c5c94164d6e0ee05b32John McCall  friend class B {}; // expected-error {{cannot define a type in a friend declaration}}
7b3df1386680b3830d2f4d300d4d7eaba134135fcDouglas Gregor  friend int; // expected-warning {{non-class friend type 'int' is a C++11 extension}}
844054452c416a622b8f19a6d157a0affc05b9aa8Douglas Gregor  friend B0; // expected-warning {{specify 'struct' to befriend 'B0'}}
967d1a67f3db2f1aa69083c5c94164d6e0ee05b32John McCall  friend class C; // okay
1067d1a67f3db2f1aa69083c5c94164d6e0ee05b32John McCall};
11