[cfe-commits] r141921 - in /cfe/trunk: include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/DiagnosticGroups.td lib/Parse/ParseTemplate.cpp lib/Sema/SemaType.cpp test/SemaCXX/cxx98-compat.cpp

Jeffrey Yasskin jyasskin at google.com
Thu Oct 13 17:04:00 PDT 2011


Author: jyasskin
Date: Thu Oct 13 19:04:00 2011
New Revision: 141921

URL: http://llvm.org/viewvc/llvm-project?rev=141921&view=rev
Log:
Revert the -Wc++98-compat flag because dgregor doesn't like it.

Removed:
    cfe/trunk/test/SemaCXX/cxx98-compat.cpp
Modified:
    cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td
    cfe/trunk/include/clang/Basic/DiagnosticGroups.td
    cfe/trunk/lib/Parse/ParseTemplate.cpp
    cfe/trunk/lib/Sema/SemaType.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td?rev=141921&r1=141920&r2=141921&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td Thu Oct 13 19:04:00 2011
@@ -53,9 +53,6 @@
 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<

Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=141921&r1=141920&r2=141921&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Thu Oct 13 19:04:00 2011
@@ -60,14 +60,6 @@
 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">;

Modified: cfe/trunk/lib/Parse/ParseTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTemplate.cpp?rev=141921&r1=141920&r2=141921&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTemplate.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTemplate.cpp Thu Oct 13 19:04:00 2011
@@ -475,10 +475,8 @@
     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 @@
   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.

Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=141921&r1=141920&r2=141921&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Thu Oct 13 19:04:00 2011
@@ -2488,11 +2488,8 @@
       // 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:

Removed: cfe/trunk/test/SemaCXX/cxx98-compat.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx98-compat.cpp?rev=141920&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/cxx98-compat.cpp (original)
+++ cfe/trunk/test/SemaCXX/cxx98-compat.cpp (removed)
@@ -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 {};





More information about the cfe-commits mailing list