From 21b7661a797ecf77fbcad4380e6dcb2ade929a18 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Tue, 23 Aug 2016 22:32:11 +0300 Subject: Parse namespaces only for current file, add Q_NAMESPACE support to qmake Parsing the other files will (re)generate the same metaobject info in two places Change-Id: I8984ed30751a7587de870f55dd427f067d1b2495 Reviewed-by: Olivier Goffart (Woboq GmbH) --- tests/auto/tools/moc/moc.pro | 3 ++- tests/auto/tools/moc/namespace.h | 7 +++++++ tests/auto/tools/moc/tst_moc.cpp | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/auto/tools/moc/namespace.h (limited to 'tests') diff --git a/tests/auto/tools/moc/moc.pro b/tests/auto/tools/moc/moc.pro index 688799048f..d2b750bdc5 100644 --- a/tests/auto/tools/moc/moc.pro +++ b/tests/auto/tools/moc/moc.pro @@ -28,7 +28,8 @@ HEADERS += using-namespaces.h no-keywords.h task87883.h c-comments.h backslash-n qtbug-35657-gadget.h \ non-gadget-parent-class.h grand-parent-gadget-class.h \ related-metaobjects-in-gadget.h \ - related-metaobjects-name-conflict.h + related-metaobjects-name-conflict.h \ + namespace.h if(*-g++*|*-icc*|*-clang*|*-llvm):!irix-*:!win32-*: HEADERS += os9-newlines.h win-newlines.h diff --git a/tests/auto/tools/moc/namespace.h b/tests/auto/tools/moc/namespace.h new file mode 100644 index 0000000000..2bb1d8e958 --- /dev/null +++ b/tests/auto/tools/moc/namespace.h @@ -0,0 +1,7 @@ +#pragma once + +#include + +namespace FooNamespace { + Q_NAMESPACE +} diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 714ae19a10..56d6939102 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -69,6 +69,7 @@ #include "non-gadget-parent-class.h" #include "grand-parent-gadget-class.h" +#include "namespace.h" #ifdef Q_MOC_RUN // check that moc can parse these constructs, they are being used in Windows winsock2.h header -- cgit v1.2.3