From 3ea6a13a01f513ab491f698109fdf189e6264203 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 21 Oct 2019 15:27:04 +0200 Subject: 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 --- tests/auto/corelib/tools/collections/tst_collections.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'tests/auto/corelib/tools/collections') 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 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 >(); } -#else -void tst_Collections::alignment() -{ - QSKIP("Compiler doesn't support necessary extension keywords"); -} -#endif - #ifndef QT_NO_TEMPLATE_TEMPLATE_PARAMETERS template class C> -- cgit v1.2.3