summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-12-19 10:10:43 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-12-20 09:43:36 +0100
commitc24404dbda48bd4f9d6ceb4777fced7b164345fd (patch)
tree5124d448d8886137b62a207ae6053e098fed470e /src/corelib
parent3ea2c18faa6f2ffdddf5051133c50424e6247ca5 (diff)
Unbreak developer build with clang-cl
Move the macro definitions for Q_DECL_UNUSED_MEMBER along with a definition for Q_DECL_UNUSED from the scope excluding icc and cl into a separate one for plain clang and cl since the attributes work with clang-cl as well. Remove the check introduced in 9782938045c33b37fe0bbb6cdf00e406cd3d837e since it is assumed that all clang versions have the attribute now. Fixes: include\QtCore/../../src/corelib/io/qloggingcategory.h(87,32): error: private field 'd' is not used [-Werror,-Wunused-private-field] Q_DECL_UNUSED_MEMBER void *d; // reserved for future use ^ include\QtCore/../../src/corelib/io/qloggingcategory.h(108,31): error: private field 'placeholder' is not used [-Werror,-Wunused-private-field] Q_DECL_UNUSED_MEMBER bool placeholder[4]; // reserved for future use Task-number: QTBUG-63512 Change-Id: I651771b085408443bb02e96698a980170fcaeb6d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qcompilerdetection.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 60dc7ce688..0091cfcb60 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -828,13 +828,14 @@
# endif
# endif
-# if defined(__has_warning)
-# if __has_warning("-Wunused-private-field")
-# define Q_DECL_UNUSED_MEMBER Q_DECL_UNUSED
-# endif
-# endif
+#endif // Q_CC_CLANG && !Q_CC_INTEL && !Q_CC_MSVC
-#endif // Q_CC_CLANG
+#if defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
+# ifndef Q_DECL_UNUSED
+# define Q_DECL_UNUSED __attribute__((__unused__))
+# endif
+# define Q_DECL_UNUSED_MEMBER Q_DECL_UNUSED
+#endif
#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG)
# define Q_COMPILER_RESTRICTED_VLA