On 7/30/26 3:00 PM, Patrick Palka wrote:
Changes in v2:
   - Outright revert r16-5967, and instead fix PR119343 more directly
     for sake of backports.

Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look
OK for trunk/16?

-- >8 --

In r16-5967-gbae0ed69e1862a we removed the mark_used call from
resolve_nondeduced_context under the rationale that it should be
the callers' responsiblity to do so.c

Removing this call however now means that resolve_nondeduced_context
could return a specialization whose type is not yet fully resolved
(i.e. has an uninstantiated noexcept or undeduced return type), and
callers that immediately inspect TREE_TYPE of the result (such as
standard_conversion and build_conditional_expr) now misbehave.

In light of such callers, this patch reverts r16-5967 and more
directly fixes the PR119343 bug by just propagating error_mark_node
from resolve_nondeduced_context during convert_to_void.

@@ -1573,7 +1573,8 @@ convert_to_void (tree expr, impl_conv_void implicit, 
tsubst_flags_t complain)
      default:;
      }
    expr = resolve_nondeduced_context (expr, complain);
-  if (!mark_single_function (expr, complain))
+  if (expr == error_mark_node
+      || !mark_single_function (expr, complain))

I still don't understand why this makes a difference, given that mark_single_function has

  if (expr == error_mark_node)
    return false;

so for expr == error_mark_node it should return false, and we should already return error_mark_node?

Jason

Reply via email to