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

Aaron Ballman aaron at aaronballman.com
Tue Feb 7 21:07:01 PST 2012


On Tue, Feb 7, 2012 at 6:36 PM, Aaron Ballman <aaron at aaronballman.com> wrote:
> On Tue, Feb 7, 2012 at 5:06 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
>> On Tue, Feb 7, 2012 at 5:46 AM, Aaron Ballman <aaron at aaronballman.com> wrote:
>>> Author: aaronballman
>>> Date: Tue Feb  7 07:46:03 2012
>>> New Revision: 149984
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=149984&view=rev
>>> Log:
>>> Hex literals without a significand no longer crash the lexer.  Fixes bug 7910
>>>
>>> Patch by Eitan Adler
>>>
>>> Modified:
>>>    cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
>>>    cfe/trunk/lib/Lex/LiteralSupport.cpp
>>>    cfe/trunk/test/Lexer/hexfloat.cpp
>>
>> This patch breaks the following (valid) code:
>>
>> double d = 0x.2p2;
>
> Good catch -- I'll add a test case and fix it up.

This patch should take care of the issue.  I added some new test cases
based off my reading of the C99 spec.  From what I could tell, we only
want to err in the case where there's no value before and no value
after the decimal.

~Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HexFloatLiteral.patch
Type: application/octet-stream
Size: 1956 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120207/7fc3885b/attachment.obj>


More information about the cfe-commits mailing list