[libcxx-commits] [libcxx] [libc++] Port #200996 to ostream (PR #226372)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 24 23:18:50 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Nico Weber (nico)

<details>
<summary>Changes</summary>

Reduces the time to compile a TU with just `#include <ostream>` from 254.7 ms ± 3.0 ms to  227.7 ms ± 2.1 ms on my system (-std=c++23, -O2, arm64 macOS).

See #<!-- -->195466 for details. Without this, the call is evaluated when the template is parsed, which evaluates format_string's consteval constructor for "\n" in every translation unit that includes <ostream>, even if nothing calls println().

No behavior change.

---
Full diff: https://github.com/llvm/llvm-project/pull/226372.diff


1 Files Affected:

- (modified) libcxx/include/__ostream/print.h (+2-2) 


``````````diff
The server is unavailable at this time. Please wait a few minutes before you try again.
``````````

</details>


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


More information about the libcxx-commits mailing list