Landing: 4598d7fcbde6

Project / Subsystem

gcc / libstdc++

Date

2026-05-21

Author

Jonathan Wakely

Commit

4598d7fcbde6dd87274a91a247134ba3c12be0cd

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
libstdc++
patch_id
commit_hash
4598d7fcbde6dd87274a91a247134ba3c12be0cd
source_type
github
headline
Libstdc++: Add missing constraints to vector and deque deduction guides
tldr
Adds constraints to `vector` and `deque` deduction guides to ensure they only accept valid allocator types.
author
Jonathan Wakely
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • libstdc++
  • vector
  • deque
  • deduction guides
  • allocator
discussion_id_link
bugzilla_pr
date
2026-05-21T00:00:00.000Z

This commit fixes missing constraints in the deduction guides for std::vector and std::deque. The deduction guides now require that the deduced type for the allocator argument must qualify as an allocator. This prevents unexpected behavior and ensures that the containers are constructed with valid allocator types. New test cases are added to verify that deduction fails when a non-allocator type is used.