Landing: a55bba03ab13

Project / Subsystem

gcc / c++

Date

2026-07-03

Author

Jakub Jelinek

Commit

a55bba03ab13df7140bcf4edd97481e584687d00

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
commit_hash
a55bba03ab13df7140bcf4edd97481e584687d00
source_type
github
headline
c++: Fix up ICEs with some metafns with non-dependent args in templates [PR126036]
tldr
Compiler fix prevents ICEs when evaluating metafunctions with non-dependent arguments within templates.
author
Jakub Jelinek
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • c++
  • compiler-error
  • template-metaprogramming
discussion_id_link
bugzilla_pr
date
2026-07-03T00:00:00.000Z

This commit resolves an internal compiler error (ICE) occurring when evaluating C++ metafunctions with non-dependent arguments inside templates. The issue arose because cxx_eval_constant_expression did not handle certain CAST_EXPR forms that potential_constant_expression_1 did. The fix introduces logic to defer constant evaluation of such metafn calls when processing_template_decl is true, preventing the ICE and ensuring correct behavior for constructs like std::array and std::meta::exception objects within templates.