diff options
Diffstat (limited to 'src/tools/moc')
-rw-r--r-- | src/tools/moc/moc.cpp | 1 | ||||
-rw-r--r-- | src/tools/moc/preprocessor.cpp | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 7300429fe0..726d1972f1 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -1060,6 +1060,7 @@ void Moc::createPropertyDef(PropertyDef &propDef) QByteArray v, v2; if (test(LPAREN)) { v = lexemUntil(RPAREN); + v = v.mid(1, v.length() - 2); // removes the '(' and ')' } else if (test(INTEGER_LITERAL)) { v = lexem(); if (l != "REVISION") diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp index 0a80c0242b..590f17c24f 100644 --- a/src/tools/moc/preprocessor.cpp +++ b/src/tools/moc/preprocessor.cpp @@ -663,9 +663,12 @@ Symbols Preprocessor::macroExpandIdentifier(Preprocessor *that, SymbolStack &sym expansion += s; } } else if (mode == Hash) { - if (index < 0 || index >= arguments.size()) { + if (index < 0) { that->error("'#' is not followed by a macro parameter"); continue; + } else if (index >= arguments.size()) { + that->error("Macro invoked with too few parameters for a use of '#'"); + continue; } const Symbols &arg = arguments.at(index); |