PR d/123264
gcc/d/ChangeLog:
* types.cc (finish_aggregate_type): Propagate struct TYPE_NAME to all
TYPE_NEXT_VARIANT types.
gcc/testsuite/ChangeLog:
* gdc.dg/pr123264.d: New test.
if (t == type)
continue;
+ TYPE_NAME (t) = TYPE_NAME (type);
TYPE_FIELDS (t) = TYPE_FIELDS (type);
TYPE_LANG_SPECIFIC (t) = TYPE_LANG_SPECIFIC (type);
TYPE_SIZE (t) = TYPE_SIZE (type);
--- /dev/null
+// { dg-do compile }
+// { dg-options "-fdump-tree-original" }
+struct S123264
+{
+ void infinite(const S123264) { }
+ auto fn = &infinite;
+}
+// { dg-final { scan-tree-dump "const struct S123264" "original" } }