Landing: c607c6861006

Project / Subsystem

gcc / c++

Date

2026-04-27

Author

Patrick Palka

Commit

c607c686100689e3e68487cd8097c2fbd3904168

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
commit_hash
c607c686100689e3e68487cd8097c2fbd3904168
source_type
github
headline
Fix decltype(id) for pointer-to-data-member access expressions
tldr
Fixes an issue where `decltype` incorrectly deduced the type of pointer-to-data-member access expressions, yielding `const int*` instead of `int`.
author
Patrick Palka
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • c++
  • decltype
  • type deduction
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-04-27T00:00:00.000Z

This commit fixes a bug where decltype incorrectly deduced the type of pointer-to-data-member access expressions. The finish_decltype_type function incorrectly stripped the outermost INDIRECT_REF, assuming it was an implicit dereference of a reference, but it was actually an explicit pointer dereference. This resulted in decltype yielding const int* instead of the expected int. This commit affect template meta-programming that relies on accurate type deduction with decltype.