From acb2faf1fea2a1d2f6090443d62ac0645f307611 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Tue, 16 Aug 2022 17:48:16 +0200 Subject: [PATCH] qcompilerdetection.h: modernize the check for exception support Use C++98's __cpp_exceptions to check if exceptions are enabled by gcc and clang. Q_CC_GNU is always defined when Q_CC_CLANG is, so simplify the condition and check only for Q_CC_GNU. Change-Id: I1e15643ded9684f9e4e6eba1be9479665b526766 Reviewed-by: Edward Welbourne --- src/corelib/global/qcompilerdetection.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 0c02891e7db..5931d16711a 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1329,8 +1329,7 @@ QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantic #if !defined(QT_NO_EXCEPTIONS) # if !defined(Q_MOC_RUN) -# if (defined(Q_CC_CLANG) && !__has_feature(cxx_exceptions)) || \ - (defined(Q_CC_GNU) && !defined(__EXCEPTIONS)) +# if defined(Q_CC_GNU) && !defined(__cpp_exceptions) # define QT_NO_EXCEPTIONS # endif # elif defined(QT_BOOTSTRAPPED)