Work around GCC co_await bugs in test macros#3092
Conversation
Related GCC issues: * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101027 * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116775 Related Catch2 issues: * catchorg#2591 * catchorg#2925
f2db3e0 to
5c8f9ec
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #3092 +/- ##
==========================================
- Coverage 91.36% 91.33% -0.03%
==========================================
Files 204 204
Lines 8903 8903
==========================================
- Hits 8134 8131 -3
- Misses 769 772 +3 🚀 New features to boost your workflow:
|
|
I had to add a variable initialiser in a test due to a now detected use of an uninitialised variable. Looks like the existing solution based on |
rajpratham1
left a comment
There was a problem hiding this comment.
This looks like a nice simplification. Replacing the previous __builtin_constant_p/false && expression machinery with the volatileFalse pattern keeps expressions type-checked without evaluating them and avoids the GCC coroutine issue. The implementation is simpler and removes a fair amount of compiler-specific macro complexity. My only question is whether the removed IBM XL/NVHPC workarounds are still unnecessary with this approach, but assuming that's been verified, this looks good to me.
Related GCC issues:
Related Catch2 issues:
REQUIRE(co_await expr)unexpectedly repeats execution in GCC #2925Use a volatile boolean to guard the unevaluated test expression instead of
CATCH_INTERNAL_IGNORE_BUT_WARN(based on__builtin_constant_p, now removed).I did not remove
CATCH_CONFIG_USE_BUILTIN_CONSTANT_P, though it now seems to be unnecessary. It's unclear to me if removing it would break user configurations.