diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-24 05:29:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-24 05:29:33 +0000 |
commit | f0b26b1d9dee57c84e55f05200802658a7312683 (patch) | |
tree | 005d2b976f12b1263f8b0fedfe967a574667942c /lib/Rewrite/HTMLRewrite.cpp | |
parent | 25d944af5d8d665611e09956954f10896c1071f6 (diff) |
Fix PR3635 by handling ## magically
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65374 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/HTMLRewrite.cpp')
-rw-r--r-- | lib/Rewrite/HTMLRewrite.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Rewrite/HTMLRewrite.cpp b/lib/Rewrite/HTMLRewrite.cpp index cf49701a1d..0ef998deb1 100644 --- a/lib/Rewrite/HTMLRewrite.cpp +++ b/lib/Rewrite/HTMLRewrite.cpp @@ -437,6 +437,11 @@ void html::HighlightMacros(Rewriter &R, FileID FID, Preprocessor& PP) { // preprocessor directives. if (Tok.is(tok::hash) && Tok.isAtStartOfLine()) continue; + + // If this is a ## token, change its kind to unknown so that repreprocessing + // it will not produce an error. + if (Tok.is(tok::hashhash)) + Tok.setKind(tok::unknown); // If this raw token is an identifier, the raw lexer won't have looked up // the corresponding identifier info for it. Do this now so that it will be |