fix: support `optional<T>` with `format_as(T)` (#3712)
Formatting a `std::optional<T>` where T had a custom `format_as(T)` function failed to compile with clang, due to `set_debug_format` being hidden by private inheritance. This fix makes the function available through a using clause.

This fixes #3712 


{"label": "fmtlib:master", "ref": "master", "sha": "649fe0fc8b9366375eab67639cab404617c527cd"}
clang reports compiler error for code that formats a variable of type std::optional<T>, where T is an enum with a `format_as` custom formatter. The same code compiles fine with gcc or msvc.
[gobolt example](https://godbolt.org/z/h6jE463jP)

The compiler error is due to the optional formatter (in fmt/std.h) calling `u.set_debug_format(set);` on line 170, and this function being private due to private inheritance (fmt/format.h - line 4055.

Adding the following line to fmt/format line 4058 solves the problem:   ` using base::set_debug_format;`. Alternatively, changing from private to public inheritance on line 4055 fixes it too.
formatting a std::optional with format_as function fails to compile using clang
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 4104d91fc7cd..f34c97b11c74 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -4053,6 +4053,7 @@ struct formatter<T, Char, enable_if_t<detail::has_format_as<T>::value>>
     : private formatter<detail::format_as_t<T>, Char> {
   using base = formatter<detail::format_as_t<T>, Char>;
   using base::parse;
+  using base::set_debug_format;
 
   template <typename FormatContext>
   auto format(const T& value, FormatContext& ctx) const -> decltype(ctx.out()) {

diff --git a/test/std-test.cc b/test/std-test.cc
index 41183dbfa941..dc1073b58fc8 100644
--- a/test/std-test.cc
+++ b/test/std-test.cc
@@ -90,6 +90,36 @@ TEST(std_test, optional) {
 #endif
 }
 
+namespace my_nso {
+enum class my_number {
+  one,
+  two,
+};
+auto format_as(my_number number) -> fmt::string_view {
+  return number == my_number::one ? "first" : "second";
+}
+
+class my_class {
+ public:
+  int av;
+
+ private:
+  friend auto format_as(const my_class& elm) -> std::string {
+    return fmt::to_string(elm.av);
+  }
+};
+}  // namespace my_nso
+TEST(std_test, optional_format_as) {
+#ifdef __cpp_lib_optional
+  EXPECT_EQ(fmt::format("{}", std::optional<my_nso::my_number>{}), "none");
+  EXPECT_EQ(fmt::format("{}", std::optional{my_nso::my_number::one}),
+            "optional(\"first\")");
+  EXPECT_EQ(fmt::format("{}", std::optional<my_nso::my_class>{}), "none");
+  EXPECT_EQ(fmt::format("{}", std::optional{my_nso::my_class{7}}),
+            "optional(\"7\")");
+#endif
+}
+
 struct throws_on_move {
   throws_on_move() = default;
 

{"std-test": {"run": "PASS", "test": "NONE", "fix": "PASS"}}
{"compile-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ostream-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "ranges-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "core-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "scan-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "color-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "chrono-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "format-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "gtest-extra-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "args-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "compile-fp-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "unicode-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "assert-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "posix-mock-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "printf-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "enforce-checks-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "format-impl-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "os-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "xchar-test": {"run": "PASS", "test": "PASS", "fix": "PASS"}}
{"std-test": {"run": "PASS", "test": "NONE", "fix": "PASS"}}
{"passed_count": 20, "failed_count": 0, "skipped_count": 0, "passed_tests": ["compile-test", "core-test", "chrono-test", "gtest-extra-test", "compile-fp-test", "unicode-test", "assert-test", "enforce-checks-test", "format-impl-test", "os-test", "xchar-test", "ostream-test", "ranges-test", "std-test", "scan-test", "color-test", "format-test", "args-test", "posix-mock-test", "printf-test"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 19, "failed_count": 0, "skipped_count": 0, "passed_tests": ["compile-test", "core-test", "chrono-test", "gtest-extra-test", "compile-fp-test", "unicode-test", "assert-test", "enforce-checks-test", "format-impl-test", "os-test", "xchar-test", "ostream-test", "ranges-test", "scan-test", "color-test", "format-test", "args-test", "posix-mock-test", "printf-test"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 20, "failed_count": 0, "skipped_count": 0, "passed_tests": ["compile-test", "core-test", "chrono-test", "gtest-extra-test", "compile-fp-test", "unicode-test", "assert-test", "enforce-checks-test", "format-impl-test", "os-test", "xchar-test", "ostream-test", "ranges-test", "std-test", "scan-test", "color-test", "format-test", "args-test", "posix-mock-test", "printf-test"], "failed_tests": [], "skipped_tests": []}