GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
c++

c++: Revert resolvedness change for nondeduced contexts

Reverts a change that caused some C++ constructs to have unresolved types, fixing bugs in standard conversions and conditional expressions.

This commit reverts a previous change that removed calls to mark C++ nondeduced contexts as used. The removal led to callers incorrectly inspecting TREE_TYPE of unresolved specializations, causing issues with standard_conversion and build_conditional_expr. The fix ensures that nondeduced contexts are properly resolved, addressing bugs in C++ template instantiation and type deduction.

In Details

Reverts r16-5967 which removed mark_used from resolve_nondeduced_context. Callers like standard_conversion and build_conditional_expr now correctly handle unresolved return types by ensuring mark_used is called, preventing TREE_TYPE misinterpretation. This resolves PR119343 and PR126406.

For Context
TREE_TYPE
A macro in GCC's internal representation that accesses the type information of a tree node. This is fundamental for type checking and transformations.
nondeduced context
A situation in C++ template instantiation where a type parameter cannot be automatically deduced from the arguments and must be explicitly specified or inferred through other means.
specialization
A concrete instantiation of a C++ template (class or function) with specific types or values for its template parameters.
Filed Under: c++templatesbugfix