https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91222
--- Comment #10 from Jan Hubicka <hubicka at ucw dot cz> --- > > > > They aren't in the anonymous namespace, but they are themselves anonymous, > > so they have no linkage. The standard says, > > > > A type without linkage shall not be used as the type of a variable or > > function with external linkage unless > > — the entity has C language linkage (7.5), or > > — the entity is declared within an unnamed namespace (7.3.1), or > > — the entity is not odr-used (3.2) or is defined in the same translation > > unit. > > > > Here 1.ii is OK under the third bullet, and 2.ii under the first bullet. > > Within extern "C" I guess we need to do structural comparison for anonymous > > types rather than rely on the ODR. > > Honza? In order to disable this for ODR merging, we need to arrange the (already long) TYPE_DECL condition in tree.c:need_assembler_name_p to be false for them or C++ get_assembler_name langhook to return NULL in this case. I wonder how we can arrange that? Honza