Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / class / class.friend / p6.cpp
blobe4c59f781e3de03e7fa831cb57ce17fb6b800883
1 // RUN: %clang_cc1 -fsyntax-only -Wc++11-compat -verify -std=c++98 %s
2 // RUN: %clang_cc1 -fsyntax-only -Wc++11-compat -verify -std=c++11 %s
4 class A {
5 friend static class B; // expected-error {{'static' is invalid in friend declarations}}
6 friend extern class C; // expected-error {{'extern' is invalid in friend declarations}}
7 #if __cplusplus < 201103L
8 friend register class E; // expected-error {{'register' is invalid in friend declarations}}
9 #else
10 friend register class E; // expected-error {{'register' is invalid in friend declarations}}
11 #endif
12 friend mutable class F; // expected-error {{'mutable' is invalid in friend declarations}}
13 friend typedef class G; // expected-error {{'typedef' is invalid in friend declarations}}
14 friend __thread class G; // expected-error {{'__thread' is invalid in friend declarations}}
15 friend _Thread_local class G; // expected-error {{'_Thread_local' is invalid in friend declarations}}
16 friend static _Thread_local class G; // expected-error {{'static _Thread_local' is invalid in friend declarations}}
17 #if __cplusplus < 201103L
18 friend auto class D; // expected-warning {{incompatible with C++11}} expected-error {{'auto' is invalid in friend declarations}}
19 #else
20 friend thread_local class G; // expected-error {{'thread_local' is invalid in friend declarations}}
21 #endif