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 template<typename T>
      5 class X0 {
      6   friend T;
      7 #if __cplusplus <= 199711L // C++03 or earlier modes
      8   // expected-warning@-2{{non-class friend type 'T' is a C++11 extension}}
      9 #else
     10   // expected-no-diagnostics
     11 #endif
     12 };
     13 
     14 class X1 { };
     15 enum E1 { };
     16 X0<X1> x0a;
     17 X0<X1 *> x0b;
     18 X0<int> x0c;
     19 X0<E1> x0d;
     20 
     21