From: Eli Friedman Date: Fri, 26 Jul 2013 00:06:39 +0000 (+0000) Subject: Move friend warning into CXX11 warning group. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6931b4da1f586d72d26773b57c55fb18da641566;p=clang Move friend warning into CXX11 warning group. Also, fix the wording to reflect this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187171 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 817a10f2a1..aa0f73cace 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -859,7 +859,7 @@ def err_inline_namespace_mismatch : Error< def err_unexpected_friend : Error< "friends can only be classes or functions">; def ext_enum_friend : ExtWarn< - "enumeration type %0 cannot be a friend">; + "befriending enumeration type %0 is a C++11 extension">, InGroup; def warn_cxx98_compat_enum_friend : Warning< "befriending enumeration type %0 is incompatible with C++98">, InGroup, DefaultIgnore; diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp index 8d58498802..40e754082b 100644 --- a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp +++ b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp @@ -14,7 +14,7 @@ class A1 { friend union A; // expected-error {{use of 'A' with tag type that does not match previous declaration}} friend enum A; // expected-error {{use of 'A' with tag type that does not match previous declaration}} - friend enum E; // expected-warning {{cannot be a friend}} + friend enum E; // expected-warning {{befriending enumeration type 'enum E' is a C++11 extension}} }; template struct B { // expected-note {{previous use is here}} diff --git a/test/Misc/warning-flags.c b/test/Misc/warning-flags.c index 9a43e48615..0a22e640a7 100644 --- a/test/Misc/warning-flags.c +++ b/test/Misc/warning-flags.c @@ -18,9 +18,8 @@ This test serves two purposes: The list of warnings below should NEVER grow. It should gradually shrink to 0. -CHECK: Warnings without flags (136): +CHECK: Warnings without flags (135): CHECK-NEXT: ext_delete_void_ptr_operand -CHECK-NEXT: ext_enum_friend CHECK-NEXT: ext_expected_semi_decl_list CHECK-NEXT: ext_explicit_specialization_storage_class CHECK-NEXT: ext_implicit_lib_function_decl