diff options
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 2cbe9ee559..30d2a294dc 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1132,11 +1132,10 @@ } while (false) #define Q_ASSUME(Expr) \ - do {\ - const bool valueOfExpression = Expr;\ + [] (bool valueOfExpression) {\ Q_ASSERT_X(valueOfExpression, "Q_ASSUME()", "Assumption in Q_ASSUME(\"" #Expr "\") was not correct");\ Q_ASSUME_IMPL(valueOfExpression);\ - } while (false) + }(Expr) #if defined(__cplusplus) #if __has_cpp_attribute(clang::fallthrough) |