Landing: 72fc51b1ac64

Project / Subsystem

gcc / libstdc++

Date

2026-04-30

Author

Jonathan Wakely

Commit

72fc51b1ac6451b2986d3351158b46b36827caf6

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
libstdc++
patch_id
commit_hash
72fc51b1ac6451b2986d3351158b46b36827caf6
source_type
github
headline
libstdc++: Improve SFINAE-friendliness of `std::unique_ptr<void>::operator*`.
tldr
Makes `std::unique_ptr<void>::operator*` SFINAE-friendly by adding a constraint for C++20 and adjusting the noexcept-specifier for older standards.
author
Jonathan Wakely
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • libstdc++
  • unique_ptr
  • sfinae
  • lwg
discussion_id_link
bugzilla_pr
date
2026-04-30T00:00:00.000Z

This commit implements LWG 4324, addressing the issue that std::unique_ptr<void>::operator* was not SFINAE-friendly due to the addition of a noexcept specifier in C++23 (LWG 2762). For C++20, a requires clause is added to constrain the function. For C++11/14/17, the noexcept specifier is adjusted to avoid ill-formed code. This change restores the original semantics, allowing code to check for the existence of the function in a SFINAE context without causing errors.