aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorHarald Anlauf <anlauf@gmx.de>2023-10-11 21:29:35 +0200
committerHarald Anlauf <anlauf@gmx.de>2023-10-13 18:54:53 +0200
commitd78fef5371759849944966dec65d9e987efba509 (patch)
tree81e8e456e2fea5bdd607ba0672a779267d6fac13 /gcc/fortran
parent458c253ccdae9df439b9a452d04e325101e5756e (diff)
downloadgcc-d78fef5371759849944966dec65d9e987efba509.zip
gcc-d78fef5371759849944966dec65d9e987efba509.tar.gz
gcc-d78fef5371759849944966dec65d9e987efba509.tar.bz2
Fortran: name conflict between internal procedure and derived type [PR104351]
gcc/fortran/ChangeLog: PR fortran/104351 * decl.cc (get_proc_name): Extend name conflict detection between internal procedure and previous declaration also to derived type. gcc/testsuite/ChangeLog: PR fortran/104351 * gfortran.dg/derived_function_interface_1.f90: Adjust pattern. * gfortran.dg/pr104351.f90: New test.
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/decl.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/fortran/decl.cc b/gcc/fortran/decl.cc
index 4a3c5b8..bdd3be3 100644
--- a/gcc/fortran/decl.cc
+++ b/gcc/fortran/decl.cc
@@ -1404,7 +1404,9 @@ get_proc_name (const char *name, gfc_symbol **result, bool module_fcn_entry)
/* Trap declarations of attributes in encompassing scope. The
signature for this is that ts.kind is nonzero for no-CLASS
entity. For a CLASS entity, ts.kind is zero. */
- if ((sym->ts.kind != 0 || sym->ts.type == BT_CLASS)
+ if ((sym->ts.kind != 0
+ || sym->ts.type == BT_CLASS
+ || sym->ts.type == BT_DERIVED)
&& !sym->attr.implicit_type
&& sym->attr.proc == 0
&& gfc_current_ns->parent != NULL