C++: Fix preprocessor blocked macro bug.

By lexing the first token after a macro call (meaning: the token after
the closing parenthesis (which was passed to handleFunctionLikeMacro
which in turn pushed it back into the token buffer)), a token buffer
might be popped, which unblocks the macro that generated the actual
param pack. The effect was that if this happens in the expansion of a
recursive macro (with parameters!), the preprocessor ended up in an
infinite loop.

Task-number: QTCREATORBUG-9015
Task-number: QTCREATORBUG-9447

Change-Id: I0d83c59188ec15c4a948970e9fa944a17d765475
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Erik Verbruggen
2013-06-10 15:12:17 +02:00
committed by Erik Verbruggen
parent d0afdfcc2b
commit 271c3f45a4
5 changed files with 26 additions and 11 deletions

View File

@@ -822,6 +822,8 @@ void tst_Preprocessor::comparisons_data()
<< "reserved.1.cpp" << "reserved.1.out.cpp" << "";
QTest::newRow("recursive 1")
<< "recursive.1.cpp" << "recursive.1.out.cpp" << "";
QTest::newRow("recursive 2")
<< "recursive.2.cpp" << "recursive.2.out.cpp" << "";
QTest::newRow("macro_pounder_fn")
<< "macro_pounder_fn.c" << "" << "";
QTest::newRow("macro_expand")