Skip to content

Commit

Permalink
Comparison helper macros: drop the check for noexcept
Browse files Browse the repository at this point in the history
Now when we explicitly have the _NON_NOEXCEPT version of the macros,
and a static_assert() in the "normal" macros, it does not make sense
to have these checks in the helper functions. If the developers choose
the _NON_NOEXCEPT macro, they clearly know what they are doing.

So simply drop the check and get rid of the annoying XFAILs in the
test log.

Pick-to: 6.8
Change-Id: Id467ae5ad6a852da7c39dd1dbf32ce5838e69ecc
Reviewed-by: Thiago Macieira <[email protected]>
  • Loading branch information
isolovev committed Aug 13, 2024
1 parent b786203 commit 80bc015
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/testlib/qcomparisontesthelper_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,6 @@ QByteArray formatTypeWithCRef()

#define CHECK_SINGLE_OPERATOR(Left, Right, Op, Result) \
do { \
constexpr bool qtest_op_check_isImplNoexcept \
= noexcept(std::declval<Left>() Op std::declval<Right>()); \
if constexpr (!qtest_op_check_isImplNoexcept) { \
QEXPECT_FAIL("", QByteArray("(" + formatTypeWithCRef<Left>() \
+ " " #Op " " + formatTypeWithCRef<Right>() \
+ ") is not noexcept").constData(), \
Continue); \
/* Ideally, operators should be noexcept, so warn if they are not. */ \
/* Do not make it a hard error, because the fix is not always trivial. */ \
QVERIFY(qtest_op_check_isImplNoexcept); \
} \
static_assert(std::is_convertible_v<decltype( \
std::declval<Left>() Op std::declval<Right>()), Result>); \
if constexpr (!std::is_same_v<Left, Right>) { \
Expand Down

0 comments on commit 80bc015

Please sign in to comment.