Skip to content

Commit

Permalink
Enable BOOST_STL_INTERFACES_USE_DEDUCED_THIS on Clang 19 and MSVC 19.41
Browse files Browse the repository at this point in the history
Clang 19 and MSVC 19.41 both have support for deducing this that is
complete enough to allow the v3 version of this library to work but
not complete enough for the compilers to define
__cpp_explicit_this_parameter. This commit enables the v3 version of
this library on compilers with that version or newer. We make use of
BOOST_CLANG_VERSION here because on AppleClang it should provide the
version of upstream Clang that was used for that release.
  • Loading branch information
ednolan authored and tzlaine committed Oct 24, 2024
1 parent 2d001de commit f89646c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/boost/stl_interfaces/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#ifndef BOOST_STL_INTERFACES_CONFIG_HPP
#define BOOST_STL_INTERFACES_CONFIG_HPP

// Included for BOOST_CLANG_VERSION
#include <boost/config.hpp>

// Included for definition of __cpp_lib_concepts.
#include <iterator>

Expand All @@ -17,7 +20,9 @@
#define BOOST_STL_INTERFACES_USE_CONCEPTS 0
#endif

#if defined(__cpp_explicit_this_parameter) && \
#if (defined(__cpp_explicit_this_parameter) || \
(defined(_MSC_VER) && _MSC_VER >= 1941) || \
(defined(BOOST_CLANG_VERSION) && BOOST_CLANG_VERSION >= 190000)) && \
BOOST_STL_INTERFACES_USE_CONCEPTS && \
!defined(BOOST_STL_INTERFACES_DISABLE_DEDUCED_THIS)
#define BOOST_STL_INTERFACES_USE_DEDUCED_THIS 1
Expand Down

1 comment on commit f89646c

@rainerdeyke
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks builds with Clang19 and -std=gnu++20.

Please sign in to comment.