[flang-commits] [openmp] [mlir] [llvm] [libc] [lldb] [clang] [compiler-rt] [flang] [clang-tools-extra] [libcxx] [lld] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

Mark de Wever via flang-commits flang-commits at lists.llvm.org
Fri Jan 19 09:10:16 PST 2024


================
@@ -144,7 +144,8 @@ _LIBCPP_HIDE_FROM_ABI decltype(auto) __visit_format_arg(_Visitor&& __vis, basic_
   __libcpp_unreachable();
 }
 
-#  if _LIBCPP_STD_VER >= 26
+#  if _LIBCPP_STD_VER >= 26 && (!defined(_LIBCPP_COMPILER_CLANG_BASED) || _LIBCPP_CLANG_VER >= 1800)
----------------
mordante wrote:

> https://clang.llvm.org/docs/ReleaseNotes.html
> 
> > Implemented P0847R7: Deducing this. Some related core issues were also implemented (CWG2553, CWG2554, CWG2653, CWG2687). Because the support for this feature is still experimental, the feature test macro __cpp_explicit_this_parameter was not set in this version.
> 
> I'll revert the change.

I looked at the status page https://clang.llvm.org/cxx_status.html which misses this detail. 

I would go with with a new config variable `_LIBCPP_HAS_EXPLICIT_THIS_PARAMETER`
```
// Clang-18 has support for deducing this, but it does not set the FTM.
#if defined(__cpp_explicit_this_parameter) || (defined(_LIBCPP_CLANG_VER ) &&_LIBCPP_CLANG_VER >= 1800))
#  define _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
#endif
```
This allows to easily add AppleClang when they support it. For the library we only support GCC and Clang based compilers.

https://github.com/llvm/llvm-project/pull/76449


More information about the flang-commits mailing list