3131#endif
3232
3333// GCC < 10 workaround for std::optional comparison ambiguity (see below)
34- #if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 10) && \
34+ #if (( defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 10)) || (defined(__clang__) && __clang_major__ < 11) ) && \
3535 (__cplusplus >= 201703L || (defined (_MSVC_LANG) && _MSVC_LANG >= 201703L ))
3636#include < optional>
3737#endif
@@ -52,8 +52,9 @@ namespace assertion {
5252template <typename T>
5353struct is_std_optional : std::false_type {};
5454
55- #if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 10) && \
55+ #if (( defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 10)) || (defined(__clang__) && __clang_major__ < 11) ) && \
5656 (__cplusplus >= 201703L || (defined (_MSVC_LANG) && _MSVC_LANG >= 201703L ))
57+
5758template <typename T>
5859struct is_std_optional <std::optional<T>> : std::true_type {};
5960template <typename T>
@@ -62,6 +63,7 @@ template<typename T>
6263struct is_std_optional <std::optional<T> const &> : std::true_type {};
6364template <typename T>
6465struct is_std_optional <std::optional<T>&&> : std::true_type {};
66+
6567#endif
6668
6769// ************************************************************************** //
@@ -222,7 +224,7 @@ BOOST_TEST_FOR_EACH_CONST_OP( DEFINE_CONST_OPER )
222224
223225template <typename Lhs, typename Rhs, typename OP> class binary_expr ;
224226
225- #if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 10) && \
227+ #if (( defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 10)) || (defined(__clang__) && __clang_major__ < 11) ) && \
226228 (__cplusplus >= 201703L || (defined (_MSVC_LANG) && _MSVC_LANG >= 201703L ))
227229
228230// Primary template - empty (for non-optional types)
@@ -311,7 +313,7 @@ class expression_base : public optional_friends_base<ExprType, ValType> {
311313// GCC < 10 workaround: comparison operators with SFINAE to exclude std::optional
312314// when ValType is also std::optional. The hidden friend operators in the base class
313315// optional_friends_base will handle the optional==optional case instead.
314- #if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 10) && \
316+ #if (( defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 10)) || (defined(__clang__) && __clang_major__ < 11) ) && \
315317 (__cplusplus >= 201703L || (defined (_MSVC_LANG) && _MSVC_LANG >= 201703L ))
316318#define ADD_OP_SUPPORT_COMP ( oper, name, _, _i ) \
317319 template <typename T, \
0 commit comments