1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -Wc++11-compat -verify -std=c++98 %s 2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -Wc++11-compat -verify -std=c++11 %s 3*f4a2713aSLionel Sambuc 4*f4a2713aSLionel Sambuc class A { 5*f4a2713aSLionel Sambuc friend static class B; // expected-error {{'static' is invalid in friend declarations}} 6*f4a2713aSLionel Sambuc friend extern class C; // expected-error {{'extern' is invalid in friend declarations}} 7*f4a2713aSLionel Sambuc #if __cplusplus < 201103L 8*f4a2713aSLionel Sambuc friend register class E; // expected-error {{'register' is invalid in friend declarations}} 9*f4a2713aSLionel Sambuc #else 10*f4a2713aSLionel Sambuc friend register class E; // expected-error {{'register' is invalid in friend declarations}} 11*f4a2713aSLionel Sambuc #endif 12*f4a2713aSLionel Sambuc friend mutable class F; // expected-error {{'mutable' is invalid in friend declarations}} 13*f4a2713aSLionel Sambuc friend typedef class G; // expected-error {{'typedef' is invalid in friend declarations}} 14*f4a2713aSLionel Sambuc friend __thread class G; // expected-error {{'__thread' is invalid in friend declarations}} 15*f4a2713aSLionel Sambuc friend _Thread_local class G; // expected-error {{'_Thread_local' is invalid in friend declarations}} 16*f4a2713aSLionel Sambuc friend static _Thread_local class G; // expected-error {{'static _Thread_local' is invalid in friend declarations}} 17*f4a2713aSLionel Sambuc #if __cplusplus < 201103L 18*f4a2713aSLionel Sambuc friend auto class D; // expected-warning {{incompatible with C++11}} expected-error {{'auto' is invalid in friend declarations}} 19*f4a2713aSLionel Sambuc #else 20*f4a2713aSLionel Sambuc friend thread_local class G; // expected-error {{'thread_local' is invalid in friend declarations}} 21*f4a2713aSLionel Sambuc #endif 22*f4a2713aSLionel Sambuc }; 23