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>
bb10
Marc Mutz 2015-11-10 12:41:37 +01:00
parent 62f2a0fb0d
commit 912df566d0
1 changed files with 5 additions and 3 deletions

View File

@ -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
}