From: Eric Botcazou Date: Mon, 7 Aug 2017 15:09:07 +0000 (+0000) Subject: c-ada-spec.c (has_nontrivial_methods): Test for FUNCTION_DECL. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=db44013866d4a8c09d781d9a6c6ca738dd889e89;p=gcc.git c-ada-spec.c (has_nontrivial_methods): Test for FUNCTION_DECL. * c-ada-spec.c (has_nontrivial_methods): Test for FUNCTION_DECL. (print_ada_methods): Likewise. (print_ada_declaration): Likewise. From-SVN: r250920 --- diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index ba007b9442c..1243eefa91e 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2017-08-07 Eric Botcazou + + * c-ada-spec.c (has_nontrivial_methods): Test for FUNCTION_DECL. + (print_ada_methods): Likewise. + (print_ada_declaration): Likewise. + 2017-08-07 Martin Liska * array-notation-common.c: Add new includes. diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index dac437d9bf6..6c050fb673b 100644 --- a/gcc/c-family/c-ada-spec.c +++ b/gcc/c-family/c-ada-spec.c @@ -1099,7 +1099,7 @@ has_nontrivial_methods (tree type) /* If there are user-defined methods, they are deemed non-trivial. */ for (tree fld = TYPE_FIELDS (type); fld; fld = DECL_CHAIN (fld)) - if (TREE_CODE (TREE_TYPE (fld)) == METHOD_TYPE && !DECL_ARTIFICIAL (fld)) + if (TREE_CODE (fld) == FUNCTION_DECL && !DECL_ARTIFICIAL (fld)) return true; return false; @@ -2442,7 +2442,7 @@ print_ada_methods (pretty_printer *buffer, tree node, int spc) int res = 1; for (tree fld = TYPE_FIELDS (node); fld; fld = DECL_CHAIN (fld)) - if (TREE_CODE (TREE_TYPE (fld)) == METHOD_TYPE) + if (TREE_CODE (fld) == FUNCTION_DECL) { if (res) { @@ -2955,8 +2955,7 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc) if (is_constructor && RECORD_OR_UNION_TYPE_P (type)) for (tree fld = TYPE_FIELDS (type); fld; fld = DECL_CHAIN (fld)) - if (TREE_CODE (TREE_TYPE (fld)) == METHOD_TYPE - && cpp_check (fld, IS_ABSTRACT)) + if (TREE_CODE (fld) == FUNCTION_DECL && cpp_check (fld, IS_ABSTRACT)) { is_abstract_class = true; break; @@ -3036,7 +3035,7 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc) is_interface = 0; has_fields = true; } - else if (TREE_CODE (TREE_TYPE (fld)) == METHOD_TYPE + else if (TREE_CODE (fld) == FUNCTION_DECL && !DECL_ARTIFICIAL (fld)) { if (cpp_check (fld, IS_ABSTRACT))