that they are C++0x extensions, and put them in the appropriate
group. We already support most of the semantics. Addresses
<rdar://problem/
9407525>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131153
91177308-0d34-0410-b5e6-
96231b3b80d8
def ext_enum_friend : ExtWarn<
"enumeration type %0 cannot be a friend">;
def ext_nonclass_type_friend : ExtWarn<
- "non-class type %0 cannot be a friend">;
+ "non-class friend type %0 is a C++0x extension">, InGroup<CXX0x>;
def err_friend_is_member : Error<
"friends cannot be members of the declaring class">;
def ext_unelaborated_friend_type : ExtWarn<
- "must specify '%select{struct|union|class|enum}0' to befriend %1">;
+ "specify '%select{struct|union|class|enum}0' to befriend %1; accepted "
+ "as a C++0x extension">, InGroup<CXX0x>;
def err_qualified_friend_not_found : Error<
"no function named %0 with type %1 was found in the specified scope">;
def err_introducing_special_friend : Error<
// RUN: %clang_cc1 -fsyntax-only -verify %s
template<typename T>
class X0 {
- friend T; // expected-warning{{non-class type 'T' cannot be a friend}}
+ friend T; // expected-warning{{non-class friend type 'T' is a C++0x extension}}
};
class X1 { };
class A {
friend class B {}; // expected-error {{cannot define a type in a friend declaration}}
- friend int; // expected-warning {{non-class type 'int' cannot be a friend}}
- friend B0; // expected-warning {{must specify 'struct' to befriend}}
+ friend int; // expected-warning {{non-class friend type 'int' is a C++0x extension}}
+ friend B0; // expected-warning {{specify 'struct' to befriend 'B0'}}
friend class C; // okay
};
// 'A' here should refer to the declaration above.
friend class A;
- friend C; // expected-warning {{must specify 'class' to befriend}}
- friend U; // expected-warning {{must specify 'union' to befriend}}
- friend int; // expected-warning {{non-class type 'int' cannot be a friend}}
+ friend C; // expected-warning {{specify 'class' to befriend}}
+ friend U; // expected-warning {{specify 'union' to befriend}}
+ friend int; // expected-warning {{non-class friend type 'int'}}
friend void myfunc();