Landing: 8aa30b41ec38
Project / Subsystem
gcc / c++
Date
2026-08-19
Author
Jakub Jelinek
Commit
8aa30b41ec381846e4c08b78d437fd896d30f5da
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- c++
- patch_id
- —
- commit_hash
- 8aa30b41ec381846e4c08b78d437fd896d30f5da
- source_type
- github
- headline
- c++: Fix constexpr exception handling for pointer-to-member types
- tldr
- Corrects constexpr exception handling for pointer-to-member types to align with C++ standard.
- author
- Jakub Jelinek
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • c++
- • constexpr
- • exception handling
- • runtime
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-08-19T00:00:00.000Z
This commit addresses several issues in GCC’s handling of exceptions thrown and caught within constexpr contexts, specifically concerning pointer-to-member types. The C++ standard specifies that when catching exceptions by pointer types, the handler receives a pointer to the exception object. However, GCC’s runtime library (libsupc++) did not correctly handle pointer-to-member types in these scenarios, leading to incorrect type information or invalid casts. This change ensures proper runtime handling for pointer-to-member exceptions in constexpr evaluations, aligning with the standard’s requirements for types like __cxa_begin_catch return values and runtime type information resolution.