parent
5b123fde96
commit
f76e62ecad
|
|
@ -307,7 +307,13 @@ void MacroExpander::ExpandFunctionArguments() {
|
|||
const LexerToken &CurTok = MacroTokens[i];
|
||||
if (CurTok.getKind() == tok::hash || CurTok.getKind() == tok::hashat) {
|
||||
int ArgNo = Macro->getArgumentNum(MacroTokens[i+1].getIdentifierInfo());
|
||||
assert(ArgNo != -1 && "Token following # is not an argument?");
|
||||
if (ArgNo == -1) {
|
||||
// Otherwise, this must be #__VA_ARGS__.
|
||||
assert(MacroTokens[i+1].getIdentifierInfo() ==
|
||||
PP.get__VA_ARGS__Identifier() &&
|
||||
"Token following # is not an argument?");
|
||||
ArgNo = Macro->getNumArgs();
|
||||
}
|
||||
|
||||
LexerToken Res;
|
||||
if (CurTok.getKind() == tok::hash) // Stringify
|
||||
|
|
|
|||
|
|
@ -1781,7 +1781,8 @@ void Preprocessor::HandleDefineDirective(LexerToken &DefineTok) {
|
|||
|
||||
// Not a macro arg identifier?
|
||||
if (!Tok.getIdentifierInfo() ||
|
||||
MI->getArgumentNum(Tok.getIdentifierInfo()) == -1) {
|
||||
(MI->getArgumentNum(Tok.getIdentifierInfo()) == -1 &&
|
||||
Tok.getIdentifierInfo() != Ident__VA_ARGS__)) {
|
||||
Diag(Tok, diag::err_pp_stringize_not_parameter);
|
||||
delete MI;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue