[libcxx-commits] [libcxx] c775d6e - [libc++] Make the body of println(FILE*) dependent on the template parameter to avoid template instantiation (#200996)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jun 14 22:35:36 PDT 2026


Author: Braden Ganetsky
Date: 2026-06-15T13:35:31+08:00
New Revision: c775d6e52b3340fa4669cfae8d1a83d968db7747

URL: https://github.com/llvm/llvm-project/commit/c775d6e52b3340fa4669cfae8d1a83d968db7747
DIFF: https://github.com/llvm/llvm-project/commit/c775d6e52b3340fa4669cfae8d1a83d968db7747.diff

LOG: [libc++] Make the body of println(FILE*) dependent on the template parameter to avoid template instantiation (#200996)

Make the function parameter of the `std::print` call inside the
`std::println` overload taking `FILE*` dependent on the template
parameter to avoid eager instantiation.

Added: 
    

Modified: 
    libcxx/include/print

Removed: 
    


################################################################################
diff  --git a/libcxx/include/print b/libcxx/include/print
index cfa844e6ab607..4a3676f97b2d7 100644
--- a/libcxx/include/print
+++ b/libcxx/include/print
@@ -338,9 +338,9 @@ println(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream, format_string<_Args...> __fmt,
 #    endif // _LIBCPP_HAS_UNICODE
 }
 
-template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
+template <class _Void = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE inline void println(FILE* _LIBCPP_DIAGNOSE_NULLPTR __stream) {
-  std::print(__stream, "\n");
+  std::print(__stream, (_Void(), "\n"));
 }
 
 template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).


        


More information about the libcxx-commits mailing list