summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTomasz Olszak <olszak.tomasz@gmail.com>2014-10-03 16:48:06 +0200
committerTomasz Olszak <olszak.tomasz@gmail.com>2014-10-10 13:20:30 +0200
commit8ddaf5c74150d18f2639aeca495ec40efd8e8add (patch)
tree9f57d0dce2400622d14a9db42022b85fee1c811d /tests
parenteaf04207bddd778380cae178db1bf3cce7d6b9df (diff)
Gcc 4.5.* build fix.
Q_COMPILER_DEFAULT_MEMBERS and Q_COMPILER_DELETE_MEMBERS are now set starting from gcc 4.6. Pre-4.6 compilers implement a non-final snapshot of N2346, hence default and delete functions are supported only if they are public. Starting from 4.6, GCC handles final version - the access modifier is not relevant. Compiler error: qsharedpointer_impl.h:717:31: error: 'QEnableSharedFromThis<T>::QEnableSharedFromThis()' declared with non-public access cannot be defaulted in the class body Change-Id: If1d3d4696f91912a09ca72bd4aa1fb07f491a0cb Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/other/compiler/tst_compiler.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/auto/other/compiler/tst_compiler.cpp b/tests/auto/other/compiler/tst_compiler.cpp
index 47345bfc43..8253a283f5 100644
--- a/tests/auto/other/compiler/tst_compiler.cpp
+++ b/tests/auto/other/compiler/tst_compiler.cpp
@@ -784,12 +784,19 @@ void tst_Compiler::cxx11_default_members()
#ifndef Q_COMPILER_DEFAULT_MEMBERS
QSKIP("Compiler does not support C++11 feature");
#else
- struct DefaultMembers
+ class DefaultMembers
{
+ protected:
DefaultMembers() = default;
+ public:
DefaultMembers(int) {}
};
- DefaultMembers dm;
+ class DefaultMembersChild: public DefaultMembers
+ {
+ public:
+ DefaultMembersChild():DefaultMembers() {};
+ };
+ DefaultMembersChild dm;
Q_UNUSED(dm);
#endif
}
@@ -799,9 +806,11 @@ void tst_Compiler::cxx11_delete_members()
#ifndef Q_COMPILER_DELETE_MEMBERS
QSKIP("Compiler does not support C++11 feature");
#else
- struct DeleteMembers
+ class DeleteMembers
{
+ protected:
DeleteMembers() = delete;
+ public:
DeleteMembers(const DeleteMembers &) = delete;
~DeleteMembers() = delete;
};