https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122483
--- Comment #26 from Alex Coplan <acoplan at gcc dot gnu.org> --- I suppose a target hook would work then. The whole thing is a mess, though. If you interpret the affects_type_identity flag literally, then one type with the attribute should be distinct from another type without the attribute, hence: void f() __attribute__((some_attribute_that_affects_type_identity)); void f(); should be rejected, the same way that: int f(); void f(); is.
