зеркало из https://github.com/microsoft/clang-1.git
Fix PR3635 by handling ## magically
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65374 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
25d944af5d
Коммит
f0b26b1d9d
|
@ -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
|
||||
|
|
|
@ -3,3 +3,9 @@
|
|||
// rdar://6562329
|
||||
#line 42 "foo.c"
|
||||
|
||||
// PR3635
|
||||
#define F(fmt, ...) fmt, ## __VA_ARGS__
|
||||
int main(int argc, char **argv) {
|
||||
return F(argc, 1);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче