===================================================================
@@ -277,6 +277,15 @@ record_common_node (struct streamer_tree
for (f = TYPE_FIELDS (node); f; f = TREE_CHAIN (f))
record_common_node (cache, f);
}
+
+ /* To make qualified type variants pass the check_qualified_type test
+ we have to make sure to properly share TYPE_NAME. Do so by also
+ pre-loading that to the cache. See PR46796.
+ ??? To properly preserve name differences from different frontends
+ we should stop pre-loading those type nodes to the cache competely
+ instead. */
+ if (TYPE_P (node))
+ record_common_node (cache, TYPE_NAME (node));
}