aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/cplusplus/pp-engine.cpp
diff options
context:
space:
mode:
authorFrancois Ferrand <[email protected]>2013-01-17 17:26:26 +0100
committerErik Verbruggen <[email protected]>2013-01-18 14:56:47 +0100
commit4c43655cec5c117f8438f795846290e569b3727e (patch)
treef16b0c02a1f32df08d5a633c3d798a0a35e63030 /src/libs/cplusplus/pp-engine.cpp
parentf7470d32305fb145fd41c53614cc382ce7b44578 (diff)
C++: fix macro calls with comment before arguments
When in 'keep comments' mode, the preprocessor does not properly handle macro calls with comments between the macro name and the opening parenthesis: "FOO /*something to say*/ (45)". Change-Id: I6fe733242e4d2ccff2985d17399d0a084917415a Reviewed-by: Erik Verbruggen <[email protected]>
Diffstat (limited to 'src/libs/cplusplus/pp-engine.cpp')
-rw-r--r--src/libs/cplusplus/pp-engine.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp
index 9938735fba9..705ea1b1a38 100644
--- a/src/libs/cplusplus/pp-engine.cpp
+++ b/src/libs/cplusplus/pp-engine.cpp
@@ -1330,6 +1330,13 @@ bool Preprocessor::collectActualArguments(PPToken *tk, QVector<QVector<PPToken>
lex(tk); // consume the identifier
+ // consume comments
+ while (tk->isComment()) {
+ lex(tk);
+ if (!tk)
+ return false;
+ }
+
if (tk->isNot(T_LPAREN))
//### TODO: error message
return false;