From 470c2a9ab6807be8a695e583a41b20ed69082260 Mon Sep 17 00:00:00 2001 From: John McCall Date: Thu, 6 Aug 2009 21:21:21 +0000 Subject: [PATCH] Drop the friend-inner-class diagnostic from an extwarn to an ext and don't guard its report on GNUMode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78338 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticSemaKinds.td | 2 +- lib/Sema/SemaDeclCXX.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 17bf188bf3..aac64cee65 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -299,7 +299,7 @@ def err_unexpected_friend : Error< "friends can only be classes or functions">; def err_friend_is_member : Error< "friends cannot be members of the declaring class">; -def extwarn_friend_inner_class : ExtWarn< +def ext_friend_inner_class : Extension< "C++ 98 does not allow inner classes as friends">; def err_unelaborated_friend_type : Error< "must specify '%select{class|union}0' in a friend " diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 63b0b3d83d..20862d4c81 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -3371,8 +3371,8 @@ Sema::DeclPtrTy Sema::ActOnFriendDecl(Scope *S, // Also, definitions currently get treated in a way that causes // this error, so only report it if we didn't see a definition. else if (RD->getDeclContext() == CurContext && - !(getLangOptions().CPlusPlus0x || getLangOptions().GNUMode)) - Diag(DS.getFriendSpecLoc(), diag::extwarn_friend_inner_class); + !getLangOptions().CPlusPlus0x) + Diag(DS.getFriendSpecLoc(), diag::ext_friend_inner_class); return DeclPtrTy::make(RD); } -- 2.40.0