================ @@ -19,19 +19,25 @@ #include "test_macros.h" #include "make_string.h" +#if _LIBCPP_STD_VER >= 26 +TEST_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations") +#endif + template <class Context, class To, class From> void test(From value) { auto store = std::make_format_args<Context>(value); const std::basic_format_args<Context> format_args{store}; - std::visit_format_arg( - [v = To(value)](auto a) { - if constexpr (std::is_same_v<To, decltype(a)>) - assert(v == a); - else - assert(false); - }, - format_args.get(0)); + auto visitor = [v = To(value)](auto a) { + if constexpr (std::is_same_v<To, decltype(a)>) + assert(v == a); + else + assert(false); + }; +#if _LIBCPP_STD_VER >= 26 + format_args.get(0).visit(visitor); +#endif + std::visit_format_arg(visitor, format_args.get(0)); ---------------- mordante wrote:
If we put this in an `#else` we don't need to disable deprecated warnings right? This function tests `get` so we don't need to add coverage for the visitor. This means the code looks like what you did in libcxx/test/support/test_basic_format_arg.h https://github.com/llvm/llvm-project/pull/76449 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits