aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-ada-spec.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-family/c-ada-spec.c')
-rw-r--r--gcc/c-family/c-ada-spec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c
index b4e159e..9bef522 100644
--- a/gcc/c-family/c-ada-spec.c
+++ b/gcc/c-family/c-ada-spec.c
@@ -960,6 +960,9 @@ is_tagged_type (const_tree type)
if (!type || !RECORD_OR_UNION_TYPE_P (type))
return false;
+ /* TYPE_METHODS is only set on the main variant. */
+ type = TYPE_MAIN_VARIANT (type);
+
for (tmp = TYPE_METHODS (type); tmp; tmp = TREE_CHAIN (tmp))
if (TREE_CODE (tmp) == FUNCTION_DECL && DECL_VINDEX (tmp))
return true;
@@ -988,6 +991,9 @@ has_nontrivial_methods (tree type)
if (!cpp_check (type, IS_TRIVIAL))
return true;
+ /* TYPE_METHODS is only set on the main variant. */
+ type = TYPE_MAIN_VARIANT (type);
+
/* If there are user-defined methods, they are deemed non-trivial. */
for (tmp = TYPE_METHODS (type); tmp; tmp = TREE_CHAIN (tmp))
if (!DECL_ARTIFICIAL (tmp))