From 91b78382b51bb19e4023da4ef1818f146b7018dc Mon Sep 17 00:00:00 2001 From: Alexis Hunt Date: Sun, 10 Jan 2010 23:37:56 +0000 Subject: Do not parse hexadecimal floating point literals in C++0x mode because they are incompatible with user-defined literals, specifically with the following form: 0x1p+1 The preprocessing-number token extends only as far as the 'p'; the '+' is not included. Previously we could get away with this extension as p was an invalid suffix, but now with user-defined literals, 'p' might well be a valid suffix and we are forced to consider it as such. This patch also adds a warning in non-0x C++ modes telling the user that this extension is incompatible with C++0x that is enabled by default (previously and with other languages, we warn only with a compliance option such as -pedantic). llvm-svn: 93135 --- clang/include/clang/Basic/DiagnosticLexKinds.td | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/include') diff --git a/clang/include/clang/Basic/DiagnosticLexKinds.td b/clang/include/clang/Basic/DiagnosticLexKinds.td index d79091a1f6b..26a80b51c85 100644 --- a/clang/include/clang/Basic/DiagnosticLexKinds.td +++ b/clang/include/clang/Basic/DiagnosticLexKinds.td @@ -84,6 +84,9 @@ def err_exponent_has_no_digits : Error<"exponent has no digits">; 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< + "hexadecimal floating constants are a C99 feature that is incompatible with " + "C++0x">; def ext_hexconstant_invalid : Extension< "hexadecimal floating constants are a C99 feature">; def ext_binary_literal : Extension< -- cgit v1.2.3