diff options
Diffstat (limited to 'src/tools/moc/preprocessor.cpp')
-rw-r--r-- | src/tools/moc/preprocessor.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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); |