Fix test build with ICC: QFlags does not auto cast to uint
I don't know why. tst_qflags.cpp(114): error: no instance of function template "verifyConstExpr" matches the argument list argument types are: (Qt::MouseButton) tst_qflags.cpp(91): note: this candidate was rejected because there is a type mismatch after argument substitution Change-Id: I84e363d735b443cb9beefffd14b9581d77933cb8 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
This commit is contained in:
parent
179fe5981f
commit
cf0c44fe83
@ -111,19 +111,19 @@ void tst_QFlags::constExpr()
|
||||
default: QVERIFY(false);
|
||||
}
|
||||
|
||||
QVERIFY(verifyConstExpr<(Qt::LeftButton | Qt::RightButton) & Qt::LeftButton>(Qt::LeftButton));
|
||||
QVERIFY(verifyConstExpr<(Qt::LeftButton | Qt::RightButton) & Qt::MiddleButton>(0));
|
||||
QVERIFY(verifyConstExpr<(Qt::LeftButton | Qt::RightButton) | Qt::MiddleButton>(Qt::LeftButton | Qt::RightButton | Qt::MiddleButton));
|
||||
QVERIFY(verifyConstExpr<~(Qt::LeftButton | Qt::RightButton)>(~(Qt::LeftButton | Qt::RightButton)));
|
||||
QVERIFY(verifyConstExpr<Qt::MouseButtons(Qt::LeftButton) ^ Qt::RightButton>(Qt::LeftButton ^ Qt::RightButton));
|
||||
QVERIFY(verifyConstExpr<Qt::MouseButtons(0)>(0));
|
||||
QVERIFY(verifyConstExpr<Qt::MouseButtons(Qt::RightButton) & 0xff>(Qt::RightButton));
|
||||
QVERIFY(verifyConstExpr<Qt::MouseButtons(Qt::RightButton) | 0xff>(0xff));
|
||||
QVERIFY(verifyConstExpr<uint((Qt::LeftButton | Qt::RightButton) & Qt::LeftButton)>(Qt::LeftButton));
|
||||
QVERIFY(verifyConstExpr<uint((Qt::LeftButton | Qt::RightButton) & Qt::MiddleButton)>(0));
|
||||
QVERIFY(verifyConstExpr<uint((Qt::LeftButton | Qt::RightButton) | Qt::MiddleButton)>(Qt::LeftButton | Qt::RightButton | Qt::MiddleButton));
|
||||
QVERIFY(verifyConstExpr<uint(~(Qt::LeftButton | Qt::RightButton))>(~(Qt::LeftButton | Qt::RightButton)));
|
||||
QVERIFY(verifyConstExpr<uint(Qt::MouseButtons(Qt::LeftButton) ^ Qt::RightButton)>(Qt::LeftButton ^ Qt::RightButton));
|
||||
QVERIFY(verifyConstExpr<uint(Qt::MouseButtons(0))>(0));
|
||||
QVERIFY(verifyConstExpr<uint(Qt::MouseButtons(Qt::RightButton) & 0xff)>(Qt::RightButton));
|
||||
QVERIFY(verifyConstExpr<uint(Qt::MouseButtons(Qt::RightButton) | 0xff)>(0xff));
|
||||
|
||||
QVERIFY(!verifyConstExpr<Qt::RightButton>(!Qt::MouseButtons(Qt::LeftButton)));
|
||||
|
||||
#if defined(__cpp_constexpr) && __cpp_constexpr-0 >= 201304
|
||||
QVERIFY(verifyConstExpr<testRelaxedConstExpr()>(Qt::MiddleButton));
|
||||
QVERIFY(verifyConstExpr<uint(testRelaxedConstExpr())>(Qt::MiddleButton));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user