[cfe-commits] r148702 - in /cfe/trunk: include/clang/Basic/DiagnosticGroups.td test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-cxx11-nowarn.cpp

Douglas Gregor dgregor at apple.com
Mon Jan 23 07:52:03 PST 2012


Author: dgregor
Date: Mon Jan 23 09:52:03 2012
New Revision: 148702

URL: http://llvm.org/viewvc/llvm-project?rev=148702&view=rev
Log:
Add -Wnarrowing as an alias for -Wc++11-narrowing, for better GCC
compatibility.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticGroups.td
    cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-cxx11-nowarn.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=148702&r1=148701&r2=148702&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Mon Jan 23 09:52:03 2012
@@ -72,8 +72,13 @@
 def CXX98CompatPedantic : DiagGroup<"c++98-compat-pedantic", [CXX98Compat]>;
 
 def CXX11Narrowing : DiagGroup<"c++11-narrowing">;
+
+// Original name of this warning in Clang
 def : DiagGroup<"c++0x-narrowing", [CXX11Narrowing]>;
 
+// Name of this warning in GCC
+def : DiagGroup<"narrowing", [CXX11Narrowing]>;
+
 def CXX11Compat : DiagGroup<"c++11-compat", [CXX11Narrowing]>;
 def : DiagGroup<"c++0x-compat", [CXX11Compat]>;
 

Modified: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-cxx11-nowarn.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-cxx11-nowarn.cpp?rev=148702&r1=148701&r2=148702&view=diff
==============================================================================
--- cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-cxx11-nowarn.cpp (original)
+++ cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-cxx11-nowarn.cpp Mon Jan 23 09:52:03 2012
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wno-error=c++11-narrowing -triple x86_64-apple-macosx10.6.7 -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wno-error=narrowing -triple x86_64-apple-macosx10.6.7 -verify %s
 
 // Verify that narrowing conversions in initializer lists cause errors in C++0x
 // mode.





More information about the cfe-commits mailing list