diff options
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -11845,11 +11845,8 @@ types_same_for_odr (tree type1, tree type2) /* Check for anonymous namespaces. Those have !TREE_PUBLIC on the corresponding TYPE_STUB_DECL. */ - if (TYPE_STUB_DECL (type1) != TYPE_STUB_DECL (type2) - && (!TYPE_STUB_DECL (type1) - || !TYPE_STUB_DECL (type2) - || !TREE_PUBLIC (TYPE_STUB_DECL (type1)) - || !TREE_PUBLIC (TYPE_STUB_DECL (type2)))) + if (type_in_anonymous_namespace_p (type1) + || type_in_anonymous_namespace_p (type2)) return false; if (!TYPE_NAME (type1)) @@ -11904,6 +11901,14 @@ obj_type_ref_class (tree ref) return TREE_TYPE (ref); } +/* Return true if T is in anonymous namespace. */ + +bool +type_in_anonymous_namespace_p (tree t) +{ + return (TYPE_STUB_DECL (t) && !TREE_PUBLIC (TYPE_STUB_DECL (t))); +} + /* Try to find a base info of BINFO that would have its field decl at offset OFFSET within the BINFO type and which is of EXPECTED_TYPE. If it can be found, return, otherwise return NULL_TREE. */ |