diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2011-10-14 00:04:00 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2011-10-14 00:04:00 +0000 |
commit | f38eaa4748ee6164d5e36309fecef71765ff8b2b (patch) | |
tree | 3012e793eaa3b273e88b1cfcfa5752eacc1abae2 | |
parent | 5fa065b55bd622f20656e0de3b1f122951146784 (diff) |
Revert the -Wc++98-compat flag because dgregor doesn't like it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141921 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/DiagnosticCommonKinds.td | 3 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticGroups.td | 8 | ||||
-rw-r--r-- | lib/Parse/ParseTemplate.cpp | 12 | ||||
-rw-r--r-- | lib/Sema/SemaType.cpp | 7 | ||||
-rw-r--r-- | test/SemaCXX/cxx98-compat.cpp | 10 |
5 files changed, 6 insertions, 34 deletions
diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td index 3ead96b52d..5aa58e3f5e 100644 --- a/include/clang/Basic/DiagnosticCommonKinds.td +++ b/include/clang/Basic/DiagnosticCommonKinds.td @@ -53,9 +53,6 @@ def err_invalid_storage_class_in_func_decl : Error< def err_expected_namespace_name : Error<"expected namespace name">; def ext_variadic_templates : ExtWarn< "variadic templates are a C++11 extension">, InGroup<CXX11>; -def warn_cxx98_compat_variadic_templates : - Warning<"variadic templates are incompatible with C++98">, - InGroup<CXX98CompatVariadicTemplates>, DefaultIgnore; def err_default_special_members : Error< "only special member functions may be defaulted">; def err_friends_define_only_namespace_scope : Error< diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index 9cbde335e4..de2f7048cd 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -60,14 +60,6 @@ def : DiagGroup<"c++0x-narrowing", [CXX11Narrowing]>; def CXX11Compat : DiagGroup<"c++11-compat", [CXX11Narrowing]>; def : DiagGroup<"c++0x-compat", [CXX11Compat]>; -// These groups warn in C++0x mode about non-C++98 constructs, and -// constructs with different behavior between the two versions of the -// language. Each particular warning should be in a specific group as -// well as the general -Wc++98-compat group. -// FIXME: This is highly incomplete. -def CXX98CompatVariadicTemplates : DiagGroup<"c++98-compat-variadic-templates">; -def CXX98Compat : DiagGroup<"c++98-compat", [CXX98CompatVariadicTemplates]>; - def : DiagGroup<"effc++">; def ExitTimeDestructors : DiagGroup<"exit-time-destructors">; def FourByteMultiChar : DiagGroup<"four-char-constants">; diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp index 3d68a4ab9d..92fe4a5f33 100644 --- a/lib/Parse/ParseTemplate.cpp +++ b/lib/Parse/ParseTemplate.cpp @@ -475,10 +475,8 @@ Decl *Parser::ParseTypeParameter(unsigned Depth, unsigned Position) { Ellipsis = true; EllipsisLoc = ConsumeToken(); - Diag(EllipsisLoc, - getLang().CPlusPlus0x - ? diag::warn_cxx98_compat_variadic_templates - : diag::ext_variadic_templates); + if (!getLang().CPlusPlus0x) + Diag(EllipsisLoc, diag::ext_variadic_templates); } // Grab the template parameter name (if given) @@ -549,10 +547,8 @@ Parser::ParseTemplateTemplateParameter(unsigned Depth, unsigned Position) { if (Tok.is(tok::ellipsis)) { EllipsisLoc = ConsumeToken(); - Diag(EllipsisLoc, - getLang().CPlusPlus0x - ? diag::warn_cxx98_compat_variadic_templates - : diag::ext_variadic_templates); + if (!getLang().CPlusPlus0x) + Diag(EllipsisLoc, diag::ext_variadic_templates); } // Get the identifier, if given. diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index dc08320cad..cee4ed67a1 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -2488,11 +2488,8 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, // it expands those parameter packs. if (T->containsUnexpandedParameterPack()) T = Context.getPackExpansionType(T, llvm::Optional<unsigned>()); - else - S.Diag(D.getEllipsisLoc(), - LangOpts.CPlusPlus0x - ? diag::warn_cxx98_compat_variadic_templates - : diag::ext_variadic_templates); + else if (!LangOpts.CPlusPlus0x) + S.Diag(D.getEllipsisLoc(), diag::ext_variadic_templates); break; case Declarator::FileContext: diff --git a/test/SemaCXX/cxx98-compat.cpp b/test/SemaCXX/cxx98-compat.cpp deleted file mode 100644 index c4956c2891..0000000000 --- a/test/SemaCXX/cxx98-compat.cpp +++ /dev/null @@ -1,10 +0,0 @@ -// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++98-compat -verify %s - -template<typename ...T> // expected-warning {{variadic templates are incompatible with C++98}} -class Variadic1 {}; - -template<template<typename> class ...T> // expected-warning {{variadic templates are incompatible with C++98}} -class Variadic2 {}; - -template<int ...I> // expected-warning {{variadic templates are incompatible with C++98}} -class Variadic3 {}; |