[cfe-commits] r59668 - in /cfe/trunk: include/clang/Lex/PTHLexer.h lib/Lex/PPDirectives.cpp lib/Lex/PPMacroExpansion.cpp lib/Lex/PTHLexer.cpp lib/Lex/Pragma.cpp

Chris Lattner clattner at apple.com
Wed Nov 19 23:36:57 PST 2008

On Nov 19, 2008, at 2:21 PM, Ted Kremenek wrote:

> Author: kremenek
> Date: Wed Nov 19 16:21:33 2008
> New Revision: 59668
> URL: http://llvm.org/viewvc/llvm-project?rev=59668&view=rev
> Log:
> When using a PTHLexer, use DiscardToEndOfLine() instead of  
> ReadToEndOfLine().

This isn't right for two reasons:

1) "#warning foo" should work with PTH.
2) "#warning la'la" should be handled correctly, even though "'la" is  
not a valid token.

I suggest removing the 'CurPTHLexer->DiscardToEndOfLine();' and making  
it an assert(0) FIXME.  We'll need to introduce a new token type for  
this, and have the PTH generation phase handle this specially.


More information about the cfe-commits mailing list