From 925745f0e3256d39bc65cd2d1ab3abc000b4e372 Mon Sep 17 00:00:00 2001 From: Quentin Bourgerie Date: Wed, 2 Mar 2022 13:27:11 +0100 Subject: [PATCH] fix(thirdlib): Compilation error with clang and not CXX17 --- compiler/include/boost-single-header/outcome.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/include/boost-single-header/outcome.hpp b/compiler/include/boost-single-header/outcome.hpp index 8ca27cb99..45fa48f96 100644 --- a/compiler/include/boost-single-header/outcome.hpp +++ b/compiler/include/boost-single-header/outcome.hpp @@ -681,10 +681,10 @@ extern "C" void _mm_pause(); #endif #endif #ifndef QUICKCPPLIB_NODISCARD -#if QUICKCPPLIB_HAS_CPP_ATTRIBUTE(nodiscard) -#define QUICKCPPLIB_NODISCARD [[nodiscard]] -#elif defined(__clang__) // deliberately not GCC +#if defined(__clang__) && !_HAS_CXX17 #define QUICKCPPLIB_NODISCARD __attribute__((warn_unused_result)) +#elif QUICKCPPLIB_HAS_CPP_ATTRIBUTE(nodiscard) +#define QUICKCPPLIB_NODISCARD [[nodiscard]] #elif defined(_MSC_VER) // _Must_inspect_result_ expands into this #define QUICKCPPLIB_NODISCARD __declspec("SAL_name" "(" "\"_Must_inspect_result_\"" "," "\"\"" "," "\"2\"" ")") __declspec("SAL_begin") __declspec("SAL_post") __declspec("SAL_mustInspect") __declspec("SAL_post") __declspec("SAL_checkReturn") __declspec("SAL_end")