From 3988ad95f757f7531e8133a10e83f74ab0ce1b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 12 Feb 2013 16:36:40 +0100 Subject: moc: Error out when detecting unterminated macro usage Exhausting the symbol list while looking for the final right parenthesis means it is missing. Task-number: QTBUG-29308 Change-Id: Iccf5897b0f5eb719699fd12d6c8e4a16ff189d9b Reviewed-by: Simon Hausmann --- src/tools/moc/preprocessor.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/tools/moc') diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp index 7430c4a86c..96b920b7cd 100644 --- a/src/tools/moc/preprocessor.cpp +++ b/src/tools/moc/preprocessor.cpp @@ -630,6 +630,8 @@ Symbols Preprocessor::macroExpandIdentifier(Preprocessor *that, SymbolStack &sym if (nesting < 0) break; + else if (!symbols.hasNext()) + that->error("missing ')' in macro usage"); } // empty VA_ARGS -- cgit v1.2.3