Landing: 1948a8632804

Project / Subsystem

gcc / c++

Date

2026-07-01

Author

Jason Merrill

Commit

1948a863280464ed60168d170ab13580bb6bb51b

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
commit_hash
1948a863280464ed60168d170ab13580bb6bb51b
source_type
github
headline
C++: co_await and ->* operator: Fix TARGET_EXPR handling.
tldr
GCC's coroutine support now correctly handles `TARGET_EXPR` when used with member function pointers and `co_await`.
author
Jason Merrill
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • c++
  • coroutines
  • member function pointer
discussion_id_link
bugzilla_pr
date
2026-07-01T00:00:00.000Z

This commit improves GCC’s handling of co_await when used with C++ member function pointers. A change in GCC version r13-9563 caused TARGET_EXPR to be used in get_member_function_from_ptrfunc, which conflicted with how flatten_await_stmt processes such expressions. This fix accommodates the reuse of TARGET_EXPR by flatten_await_stmt, resolving issues for coroutines involving member function pointers and co_await, as reported in PR121094 and PR117259.