From 912df566d0ea99786cb31bc8fabea420d25a572f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 10 Nov 2015 12:41:37 +0100 Subject: [PATCH] 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) Reviewed-by: Thiago Macieira --- tests/auto/other/compiler/tst_compiler.cpp | 8 +++++--- 1 file 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 }