-
Bug
-
Resolution: Done
-
Not Evaluated
-
Qt Creator 2.6.0-rc
-
None
-
f978400ae5c9a7802c110ccd77db9a4dc8a95262
The new preprocessor does not correctly handle expansion of macro arguments: when a macro argument is/uses a macro, that macro may generate multiple arguments when it is expanded. The macro arguments should be expanded first, then expanded token list is used for
Here is a sample of showing the issue:
#define BAR 2,3,4
#define FOO(a,b,c) a+b+c
FOO(BAR) --> expands as "2,3,4+" instead of 2+3+4
Note: the generated code includes only one '+', as generation stops when Preprocessor::handleFunctionLikeMacro() finds out there are not enough argument. This does not seem correct: if the number of arguments (after expanding them) does not match the formal parameters for the macro, then that macro should not be expanded at all.