Skip to content

Commit 3efd897

Browse files
committed
Apply same workaround for clangs < 10
1 parent be5918d commit 3efd897

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

include/boost/test/tools/assertion.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
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 {
5252
template<typename T>
5353
struct 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+
5758
template<typename T>
5859
struct is_std_optional<std::optional<T>> : std::true_type {};
5960
template<typename T>
@@ -62,6 +63,7 @@ template<typename T>
6263
struct is_std_optional<std::optional<T> const&> : std::true_type {};
6364
template<typename T>
6465
struct 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

223225
template<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

Comments
 (0)