[cfe-commits] r49535 - /cfe/trunk/lib/Lex/Lexer.cpp

Chris Lattner sabre at nondot.org
Fri Apr 11 22:54:38 PDT 2008


On Apr 11, 2008, at 6:39 PM, Neil Booth wrote:

>>
>>   // If the file was empty or didn't end in a newline, issue a  
>> pedwarn.
>> -  if (CurPtr[-1] != '\n' && CurPtr[-1] != '\r')
>> +  if (CurPtr == BufferStart || (CurPtr[-1] != '\n' && CurPtr[-1] ! 
>> = '\r'))
>>     Diag(BufferEnd, diag::ext_no_newline_eof);
>
> I don't think this is right Chris.  This will warn about an empty
> file; the standard explicitly gives empty files a free pass.  The
> following text is the reason for the existence of this diagnostic
> (5.1.1.2p2):

Fixed, thanks Neil!

-Chris



More information about the cfe-commits mailing list