diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2019-10-21 15:27:04 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2019-10-29 10:37:09 +0100 |
commit | 3ea6a13a01f513ab491f698109fdf189e6264203 (patch) | |
tree | 27548766ee6714e0bb3c78399b066cbf9d67628d /tests/auto/corelib/tools/collections/tst_collections.cpp | |
parent | 226a60baf50c9c91a98c01c3dd9c0ced750f8d0e (diff) |
Replace usage of Q_DECL_ALIGN with C++11 alignas keyword
The macro is not documented, so can be considered private API.
Pre-C++11 compilers that don't support alignas will no longer be
supported with Qt 6.
The macro definition for the standard case of compilers supporting
the alignof keyword is left in place.
Task-number: QTBUG-76414
Change-Id: I7d722e4faf09ae998a972d3ed914de808ab316d7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/tools/collections/tst_collections.cpp')
-rw-r--r-- | tests/auto/corelib/tools/collections/tst_collections.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/tests/auto/corelib/tools/collections/tst_collections.cpp b/tests/auto/corelib/tools/collections/tst_collections.cpp index 8aca12f9d6..a9adda2750 100644 --- a/tests/auto/corelib/tools/collections/tst_collections.cpp +++ b/tests/auto/corelib/tools/collections/tst_collections.cpp @@ -3214,9 +3214,7 @@ void tst_Collections::forwardDeclared() { typedef QSet<T1> C; C *x = 0; /* C::iterator i; */ C::const_iterator j; Q_UNUSED(x) } } -#if defined(Q_DECL_ALIGN) - -class Q_DECL_ALIGN(4) Aligned4 +class alignas(4) Aligned4 { char i; public: @@ -3242,7 +3240,7 @@ Q_STATIC_ASSERT(alignof(Aligned4) % 4 == 0); # define BIGGEST_ALIGNMENT_TO_TEST 128 #endif -class Q_DECL_ALIGN(BIGGEST_ALIGNMENT_TO_TEST) AlignedBiggest +class alignas(BIGGEST_ALIGNMENT_TO_TEST) AlignedBiggest { char i; public: @@ -3325,13 +3323,6 @@ void tst_Collections::alignment() testAssociativeContainerAlignment<QHash<AlignedBiggest, AlignedBiggest> >(); } -#else -void tst_Collections::alignment() -{ - QSKIP("Compiler doesn't support necessary extension keywords"); -} -#endif - #ifndef QT_NO_TEMPLATE_TEMPLATE_PARAMETERS template<template<class> class C> |