]> granicus.if.org Git - clang/commitdiff
Revert the -Wc++98-compat flag because dgregor doesn't like it.
authorJeffrey Yasskin <jyasskin@google.com>
Fri, 14 Oct 2011 00:04:00 +0000 (00:04 +0000)
committerJeffrey Yasskin <jyasskin@google.com>
Fri, 14 Oct 2011 00:04:00 +0000 (00:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141921 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticCommonKinds.td
include/clang/Basic/DiagnosticGroups.td
lib/Parse/ParseTemplate.cpp
lib/Sema/SemaType.cpp
test/SemaCXX/cxx98-compat.cpp [deleted file]

index 3ead96b52da0d6506037c4f98e441d0ecefcbe99..5aa58e3f5e1f3a3e9118d919ad9e2b24125c1b8c 100644 (file)
@@ -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<
index 9cbde335e49610316b64ea79e302e56b836c85ad..de2f7048cdc52db1435e504ab7a148d58b19bea4 100644 (file)
@@ -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">;
index 3d68a4ab9db8e29e294f5625925c98598f2c1814..92fe4a5f335faaf442febe5bb2bf3dea747d8e17 100644 (file)
@@ -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.
index dc08320cad71caf1d68fe7af3aa5faab384830ad..cee4ed67a1fed2381cc416807704d3baea5a438e 100644 (file)
@@ -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 (file)
index c4956c2..0000000
+++ /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 {};