Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / class / class.friend / p2.cpp
blobe4a46b30e788818287d6e252c11636858453f969
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
5 struct B0;
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