Landing: 94b37910f620

Project / Subsystem

gcc / libstdc++

Date

2026-04-28

Author

Tomasz Kamiński

Commit

94b37910f620ecafe6526bfd37722a86517c3f0d

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
libstdc++
patch_id
commit_hash
94b37910f620ecafe6526bfd37722a86517c3f0d
source_type
github
headline
libstdc++: Make pointer_traits::pointer_to constexpr for main template.
tldr
The `pointer_traits::pointer_to` function in libstdc++ is now `constexpr` since C++20, allowing compile-time evaluation.
author
Tomasz Kamiński
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • libstdc++
  • constexpr
  • c++20
  • templates
discussion_id_link
bugzilla_pr
date
2026-04-28T00:00:00.000Z

This commit makes pointer_traits::pointer_to constexpr for the main template in libstdc++, aligning with the resolution of LWG3454 from the C++ standard. This change enables compile-time evaluation of pointer_to when used with pointer types in C++20 and later. A new test case is added to verify the constexpr behavior with custom pointer-like types.