C++: Fine tune behavior of "expand macros" flag

Even if "expand funcion-like macros" is unset we still
perform the expansion in the case it's already doing
so - when it originally started from an object-like macro.

Task-number: QTCREATORBUG-7712
Change-Id: Ie2a24de227f757d195146477d48246472082d28a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Leandro Melo
2012-09-11 14:18:24 +02:00
committed by hjk
parent 69697c5aff
commit cd6b440a18

View File

@@ -810,8 +810,11 @@ bool Preprocessor::handleIdentifier(PPToken *tk)
PPToken oldMarkerTk;
if (macro->isFunctionLike()) {
if (!expandFunctionlikeMacros())
if (!expandFunctionlikeMacros()
// Still expand if this originally started with an object-like macro.
&& m_state.m_expansionStatus != Expanding) {
return false;
}
// Collect individual tokens that form the macro arguments.
QVector<QVector<PPToken> > allArgTks;