Fix double expansion of macro arguments.
This adds a new fullyExpanded flag that makes sure that macro arguments only get expanded once. This can happen either in PrescanMacroArg, or, if there is token pasting or a function-like macro name has been passed as an argument and may need to be expanded when used as a function.
This commit is contained in:
parent
14e5a04e70
commit
c43008e829
6 changed files with 39 additions and 15 deletions
|
|
@ -195,9 +195,9 @@ bool TPpContext::TokenStream::peekUntokenizedPasting()
|
|||
return pasting;
|
||||
}
|
||||
|
||||
void TPpContext::pushTokenStreamInput(TokenStream& ts, bool prepasting)
|
||||
void TPpContext::pushTokenStreamInput(TokenStream& ts, bool prepasting, bool expanded)
|
||||
{
|
||||
pushInput(new tTokenInput(this, &ts, prepasting));
|
||||
pushInput(new tTokenInput(this, &ts, prepasting, expanded));
|
||||
ts.reset();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue