diff options
Diffstat (limited to 'lib/Lex/TokenLexer.cpp')
-rw-r--r-- | lib/Lex/TokenLexer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Lex/TokenLexer.cpp b/lib/Lex/TokenLexer.cpp index 819bb3f43e..de704ee3d7 100644 --- a/lib/Lex/TokenLexer.cpp +++ b/lib/Lex/TokenLexer.cpp @@ -225,6 +225,12 @@ void TokenLexer::ExpandFunctionArguments() { Token &Tok = ResultToks[i]; if (Tok.is(tok::hashhash)) Tok.setKind(tok::unknown); + // In Microsoft-compatibility mode, we follow MSVC's preprocessing + // behaviour by not considering commas from nested macro expansions + // as argument separators. Set a flag on the token so we can test + // for this later when the macro expansion is processed. + if (Tok.is(tok::comma) && PP.getLangOpts().MicrosoftMode) + Tok.setFlag(Token::IgnoredComma); } if(ExpandLocStart.isValid()) { |