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

Hristo Hristov llvmlistbot at llvm.org
Fri Jan 19 21:26:52 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)
----------------
H-G-Hristov wrote:

> 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.

Thank you! Done!

I think we also need to disable the test on Apple Clang, so I added:
`// UNSUPPORTED: clang-16 || clang-17 || apple-clang`

I hope this is the way.

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


More information about the Mlir-commits mailing list