forked from OSchip/llvm-project
Fix test/Preprocessor/macro_paste_spacing.c
llvm-svn: 38734
This commit is contained in:
parent
01ecf835c2
commit
e8dcfef324
|
@ -372,6 +372,10 @@ void MacroExpander::Lex(LexerToken &Tok) {
|
|||
return PPCache.Lex(Tok);
|
||||
}
|
||||
|
||||
// If this is the first token of the expanded result, we inherit spacing
|
||||
// properties later.
|
||||
bool isFirstToken = CurToken == 0;
|
||||
|
||||
// Get the next token to return.
|
||||
Tok = (*MacroTokens)[CurToken++];
|
||||
|
||||
|
@ -395,7 +399,7 @@ void MacroExpander::Lex(LexerToken &Tok) {
|
|||
|
||||
// If this is the first token, set the lexical properties of the token to
|
||||
// match the lexical properties of the macro identifier.
|
||||
if (CurToken == 1) {
|
||||
if (isFirstToken) {
|
||||
Tok.SetFlagValue(LexerToken::StartOfLine , AtStartOfLine);
|
||||
Tok.SetFlagValue(LexerToken::LeadingSpace, HasLeadingSpace);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// RUN: clang %s -E | grep "^xy$"
|
||||
|
||||
#define A x ## y
|
||||
blah
|
||||
|
||||
A
|
||||
|
Loading…
Reference in New Issue