https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119401

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
We crash in convert_nontype_argument on

  gcc_assert (same_type_ignoring_top_level_qualifiers_p
              (type, TREE_TYPE (expr)));

because type=struct ._anon_3 and TREE_TYPE (expr)=const struct ._anon_1.


r15-7202 changed the mangling of certain lambdas, e.g. their
LAMBDA_EXPR_SCOPE_SIG_DISCRIMINATOR has changed.  A consequence of that is that
when we call create_template_parm_object for {} with type ._anon_3, we mangle
it to _ZTAXtlN1AIiEUlvE_EEE which is "template parameter object for
A<int>::{lambda()#1}{}".  We'd previously created that object, so
get_template_parm_object finds it:

  tree decl = get_global_binding (name);
  if (decl)
    return decl;

but then we end up with the mismatch in convert_nontype_argument, which gets
the decl above as its expr.


I'd assume that the fix is for convert_nontype_argument to cope with this
situation?

Reply via email to