summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-11-10 12:41:37 +0100
committerMarc Mutz <marc.mutz@kdab.com>2015-11-19 07:43:34 +0000
commit912df566d0ea99786cb31bc8fabea420d25a572f (patch)
treec26889d47096962b66506f0183eab73d48f0f6c3 /tests/auto
parent62f2a0fb0dd43f16c59897b0f77cfdddd9332a03 (diff)
tst_compiler: make the check for C++14 return type deduction harder
Recurse into self must work, e.g. Change-Id: I2cccd3d40d2ab5c75a18bf4425b790d30b4d7af0 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/other/compiler/tst_compiler.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/auto/other/compiler/tst_compiler.cpp b/tests/auto/other/compiler/tst_compiler.cpp
index 2c95002cb2..e1db8d8aaf 100644
--- a/tests/auto/other/compiler/tst_compiler.cpp
+++ b/tests/auto/other/compiler/tst_compiler.cpp
@@ -1265,9 +1265,11 @@ void tst_Compiler::cxx14_decltype_auto()
}
#if __cpp_return_type_deduction >= 201304
-auto returnTypeDeduction()
+auto returnTypeDeduction(bool choice)
{
- return 1U;
+ if (choice)
+ return 1U;
+ return returnTypeDeduction(!choice);
}
#endif
@@ -1276,7 +1278,7 @@ void tst_Compiler::cxx14_return_type_deduction()
#if __cpp_return_type_deduction-0 < 201304
QSKIP("Compiler does not support this C++14 feature");
#else
- QCOMPARE(returnTypeDeduction(), 1U);
+ QCOMPARE(returnTypeDeduction(false), 1U);
#endif
}