summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-03-29 14:01:50 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-03-29 15:59:48 +0200
commit5925daf969c8f271458ca81e49f0e675a4c5c912 (patch)
tree00b3801c4ca52de0213ab3a95e7fad516711fbc4 /tests/auto/tools
parentc8f6f8a2220ce8fd628c969f19dfae6f38d7311c (diff)
Silence a bunch of gcc warnings for the moc test
We deliberately expose moc to warning-worthy C++, but we don't want the compiler warnings coming from those. Change-Id: I09c36d7c8bfbb88f7bde61fa7bcc52a5adde81da Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/tools')
-rw-r--r--tests/auto/tools/moc/cxx-attributes.h1
-rw-r--r--tests/auto/tools/moc/cxx11-explicit-override-control.h5
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp6
3 files changed, 11 insertions, 1 deletions
diff --git a/tests/auto/tools/moc/cxx-attributes.h b/tests/auto/tools/moc/cxx-attributes.h
index abd75afe98..c4f27eb8c4 100644
--- a/tests/auto/tools/moc/cxx-attributes.h
+++ b/tests/auto/tools/moc/cxx-attributes.h
@@ -33,6 +33,7 @@
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wunknown-attributes")
+QT_WARNING_DISABLE_GCC("-Wattributes")
class CppAttribute : public QObject
{
diff --git a/tests/auto/tools/moc/cxx11-explicit-override-control.h b/tests/auto/tools/moc/cxx11-explicit-override-control.h
index 961d7c47c2..2fcf0fdb2d 100644
--- a/tests/auto/tools/moc/cxx11-explicit-override-control.h
+++ b/tests/auto/tools/moc/cxx11-explicit-override-control.h
@@ -36,6 +36,9 @@
# define sealed
#endif
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_GCC("-Wsuggest-override")
+
class ExplicitOverrideControlBase : public QObject
{
Q_OBJECT
@@ -234,6 +237,8 @@ private Q_SLOTS:
#endif
};
+QT_WARNING_POP
+
#ifndef Q_MOC_RUN
# undef final
# undef sealed
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 8ce2382600..110b6b2d05 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -322,6 +322,8 @@ public:
void foo(struct ForwardDeclaredStruct *);
};
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_GCC("-Wunused-variable")
void StructQObject::foo(struct ForwardDeclaredStruct *)
{
struct Inner {
@@ -330,10 +332,11 @@ void StructQObject::foo(struct ForwardDeclaredStruct *)
Q_DECL_UNUSED_MEMBER struct Inner unusedVariable;
}
-
+QT_WARNING_POP
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wignored-qualifiers")
+QT_WARNING_DISABLE_GCC("-Wignored-qualifiers")
class TestClass : public MyNamespace::TestSuperClass, public DONT_CONFUSE_MOC(MyStruct),
public DONT_CONFUSE_MOC_EVEN_MORE(MyStruct2, dummy, ignored)
@@ -1764,6 +1767,7 @@ void tst_Moc::QTBUG5590_dummyProperty()
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wignored-qualifiers")
+QT_WARNING_DISABLE_GCC("-Wignored-qualifiers")
class QTBUG7421_ReturnConstTemplate: public QObject
{ Q_OBJECT
public slots: