summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools/moc/unterminated-function-macro.h
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-02-12 16:36:40 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-19 20:51:44 +0100
commiteb09f9b82c249db096754d9cbeea3424149c1869 (patch)
treeb6955d302fc86cf7a33074d25b9d1100ad578baa /tests/auto/tools/moc/unterminated-function-macro.h
parentc02a2f8e76bcad5814134414c4c860d64880ebcd (diff)
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 <simon.hausmann@digia.com>
Diffstat (limited to 'tests/auto/tools/moc/unterminated-function-macro.h')
-rw-r--r--tests/auto/tools/moc/unterminated-function-macro.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/unterminated-function-macro.h b/tests/auto/tools/moc/unterminated-function-macro.h
new file mode 100644
index 0000000000..813d60f0e4
--- /dev/null
+++ b/tests/auto/tools/moc/unterminated-function-macro.h
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+class Dummy : public QObject {
+ Q_OBJECT
+}
+
+#define MACRO(arg) do_something(arg)
+
+static void foo() {
+ MACRO(foo
+}
+