Home | History | Annotate | Download | only in class.friend
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
      3 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
      4 
      5 struct B0;
      6 
      7 class A {
      8   friend class B {}; // expected-error {{cannot define a type in a friend declaration}}
      9   friend int;
     10 #if __cplusplus <= 199711L
     11   // expected-warning@-2 {{non-class friend type 'int' is a C++11 extension}}
     12 #endif
     13   friend B0;
     14 #if __cplusplus <= 199711L
     15   // expected-warning@-2 {{unelaborated friend declaration is a C++11 extension; specify 'struct' to befriend 'B0'}}
     16 #endif
     17   friend class C; // okay
     18 };
     19