[cfe-commits] r104295 - in /cfe/trunk: include/clang/Basic/DiagnosticLexKinds.td test/Lexer/hexfloat.cpp

Chris Lattner sabre at nondot.org
Thu May 20 16:33:51 PDT 2010


Author: lattner
Date: Thu May 20 18:33:51 2010
New Revision: 104295

URL: http://llvm.org/viewvc/llvm-project?rev=104295&view=rev
Log:
Don't warn about use of hex floats in c++ mode by default,
matching G++'s behavior.

Warn when -pedantic or -Wc++-hex-floats is passed, and
don't warn if -pedantic -Wno-c++-hex-floats are both passed.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
    cfe/trunk/test/Lexer/hexfloat.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td?rev=104295&r1=104294&r2=104295&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td Thu May 20 18:33:51 2010
@@ -84,9 +84,9 @@
 def ext_imaginary_constant : Extension<"imaginary constants are an extension">;
 def err_hexconstant_requires_exponent : Error<
   "hexadecimal floating constants require an exponent">;
-def ext_hexconstant_cplusplus : ExtWarn<
+def ext_hexconstant_cplusplus : Extension<
   "hexadecimal floating constants are a C99 feature that is incompatible with "
-  "C++0x">;
+  "C++0x">, InGroup<DiagGroup<"c++-hex-floats">>;
 def ext_hexconstant_invalid : Extension<
   "hexadecimal floating constants are a C99 feature">;
 def ext_binary_literal : Extension<

Modified: cfe/trunk/test/Lexer/hexfloat.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/hexfloat.cpp?rev=104295&r1=104294&r2=104295&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/hexfloat.cpp (original)
+++ cfe/trunk/test/Lexer/hexfloat.cpp Thu May 20 18:33:51 2010
@@ -1,5 +1,5 @@
-//RUN: %clang_cc1 -fsyntax-only -verify
-//RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify
+// RUN: %clang_cc1 -fsyntax-only -verify -pedantic
+// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify
 
 #ifndef __GXX_EXPERIMENTAL_CXX0X__
 float f = 0x1p+1; // expected-warning {{incompatible with C++0x}}





More information about the cfe-commits mailing list