[libcxx-commits] [libcxx] [libc++][format] Decay character arrays in formatting (PR #116571)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 26 18:08:55 PST 2024


================
@@ -101,20 +101,14 @@ consteval __arg_t __determine_arg_t() {
   return __arg_t::__long_double;
 }
 
-// Char pointer
+// Char pointer or array
 template <class _Context, class _Tp>
-  requires(same_as<typename _Context::char_type*, _Tp> || same_as<const typename _Context::char_type*, _Tp>)
+  requires(same_as<typename _Context::char_type*, _Tp> || same_as<const typename _Context::char_type*, _Tp>) ||
+          (is_array_v<_Tp> && same_as<_Tp, typename _Context::char_type[extent_v<_Tp>]>)
----------------
frederick-vs-ja wrote:

Yes, although this is pre-existing. I think we should handle character arrays more properly.

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


More information about the libcxx-commits mailing list