[cfe-commits] r93135 - in /cfe/trunk: include/clang/Basic/DiagnosticLexKinds.td lib/Lex/Lexer.cpp lib/Lex/LiteralSupport.cpp test/Lexer/hexfloat.cpp

Eli Friedman eli.friedman at gmail.com
Sun Jan 10 17:04:00 PST 2010


On Sun, Jan 10, 2010 at 3:37 PM, Sean Hunt <rideau3 at gmail.com> wrote:
> Author: coppro
> Date: Sun Jan 10 17:37:56 2010
> New Revision: 93135
>
> URL: http://llvm.org/viewvc/llvm-project?rev=93135&view=rev
> Log:
> 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

Wow, that is seriously nasty... we should see if it's possible to fix
the standard here.

> --- cfe/trunk/test/Lexer/hexfloat.cpp (added)
> +++ cfe/trunk/test/Lexer/hexfloat.cpp Sun Jan 10 17:37:56 2010
> @@ -0,0 +1,8 @@
> +//RUN: %clang_cc1 -fsyntax-only -verify
> +//RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify
> +
> +#ifndef __GXX_EXPERIMENTAL_CXX0X__
> +float f = 0x1p+1; // expected-warning {{incompatible with C++0x}}
> +#else
> +float f = 0x1p+1; // expected-warning {{invalid suffix}}
> +#endif

Because you forgot to put %s in the runlines, this test doesn't actually run.

-Eli




More information about the cfe-commits mailing list