https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115605
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pinskia at gcc dot gnu.org Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Keywords| |rejects-valid Last reconfirmed| |2024-06-24 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. Note tuple_element has the same issue. The code seems like what I would have expected it to do: tree inst = lookup_template_class (tuple_size_identifier, args, /*in_decl*/NULL_TREE, /*context*/std_node, tf_none); tree inst = lookup_template_class (tuple_element_identifier, args, /*in_decl*/NULL_TREE, /*context*/std_node, tf_warning_or_error); You might end up with the same issue with coroutine_handle too. tree handle_type = lookup_template_class (coro_handle_identifier, targ, /* in_decl=*/NULL_TREE, /* context=*/std_node, tf_warning_or_error); Though that might happen outside a function context.