Landing: 571aae1dc596
Project / Subsystem
gcc / c++
Date
2026-07-23
Author
Jakub Jelinek
Commit
571aae1dc596ec58bca11534800a857109dce498
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- c++
- patch_id
- —
- commit_hash
- 571aae1dc596ec58bca11534800a857109dce498
- source_type
- github
- headline
- C++: Diagnose return from [[noreturn]] function in constant evaluation.
- tldr
- GCC now diagnoses calls to [[noreturn]] functions that 'return' during constant evaluation.
- author
- Jakub Jelinek
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • c++
- • constexpr
- • noreturn
- • diagnostics
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-23T00:00:00.000Z
GCC now correctly diagnoses undefined behavior when a function marked with [[noreturn]] actually returns during constant evaluation. Previously, this scenario was not explicitly checked, potentially leading to incorrect code generation or confusing runtime behavior. New test cases in the testsuite verify this new diagnostic check.