summaryrefslogtreecommitdiffstats
path: root/src/tools/moc
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-10-23 14:01:35 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-10-23 14:45:03 +0200
commit790aef362fd195adf97d8c780a7cbbbade27d51f (patch)
tree8be464687ab21806cfe9f7ada27098b563aa41b2 /src/tools/moc
parent9720efbd1035c2e939b0581163e6d804c713dd96 (diff)
parent07475c662eb73c833da2d461b8ef2702ca1e2cfb (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: .qmake.conf configure src/corelib/global/qglobal.h src/tools/qdoc/node.cpp src/tools/qdoc/qdocdatabase.cpp tests/auto/corelib/io/qsettings/tst_qsettings.cpp tools/configure/configureapp.cpp Change-Id: I66028ae5e441a06b73ee85ba72a03a3af3e8593f
Diffstat (limited to 'src/tools/moc')
-rw-r--r--src/tools/moc/moc.cpp1
-rw-r--r--src/tools/moc/preprocessor.cpp5
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);