brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · e4c59f7 Raw
23 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -Wc++11-compat -verify -std=c++98 %s2// RUN: %clang_cc1 -fsyntax-only -Wc++11-compat -verify -std=c++11 %s3 4class 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 < 201103L8  friend register class E; // expected-error {{'register' is invalid in friend declarations}}9#else10  friend register class E; // expected-error {{'register' is invalid in friend declarations}}11#endif12  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 < 201103L18  friend auto class D; // expected-warning {{incompatible with C++11}} expected-error {{'auto' is invalid in friend declarations}}19#else20  friend thread_local class G; // expected-error {{'thread_local' is invalid in friend declarations}}21#endif22};23