From ecfbb4e441ec7870c96de664189c373f3e527e72 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 18 Sep 2013 18:43:32 +0200 Subject: tst_QFlags: make constExpr() check compile on clang trunk The problem is the verifyConstExpr<>() line involving the ~ operator. The result as an integer is a value that can no longer be represented in an int. This is known at compile time and thus template deduction, which only has an int to match against, fails. To fix, use an unsigned int as the first template argument of verifyConstExpr<>(). Clang's error message for this is really sub-optimal, cf. http://llvm.org/bugs/show_bug.cgi?id=17834 Change-Id: I3a77dc54d2bee12b016d75724ac1bd7801f4cf2d Reviewed-by: Olivier Goffart --- tests/auto/corelib/global/qflags/tst_qflags.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/corelib/global/qflags/tst_qflags.cpp b/tests/auto/corelib/global/qflags/tst_qflags.cpp index e50a6b63fe..73a69a1309 100644 --- a/tests/auto/corelib/global/qflags/tst_qflags.cpp +++ b/tests/auto/corelib/global/qflags/tst_qflags.cpp @@ -99,7 +99,7 @@ void tst_QFlags::testFlagMultiBits() const } } -template bool verifyConstExpr(T n) { return n == N; } +template bool verifyConstExpr(T n) { return n == N; } void tst_QFlags::constExpr() { -- cgit v1.2.3