aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorHarald Anlauf <anlauf@gmx.de>2020-06-11 21:03:48 +0200
committerHarald Anlauf <anlauf@gmx.de>2020-06-11 21:07:49 +0200
commit393ccb72566dc004b9ab5c3b8fb6fdca6c095812 (patch)
treea7b84fcc554681c6ab64073544843e58df52efc6 /gcc
parent7fd614ee818983274eb5e47cbb8ec68b20994963 (diff)
downloadgcc-393ccb72566dc004b9ab5c3b8fb6fdca6c095812.zip
gcc-393ccb72566dc004b9ab5c3b8fb6fdca6c095812.tar.gz
gcc-393ccb72566dc004b9ab5c3b8fb6fdca6c095812.tar.bz2
PR fortran/95611 - ICE in access_attr_decl, at fortran/decl.c:9075
When reporting a duplicate access specification of an operator, refer to the proper symbol. 2020-06-11 Harald Anlauf <anlauf@gmx.de> gcc/fortran/ PR fortran/95611 * decl.c (access_attr_decl): Use correct symbol in error message. Co-Authored-By: Steven G. Kargl <kargl@gcc.gnu.org>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/decl.c2
-rw-r--r--gcc/testsuite/gfortran.dg/pr95611.f907
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 1c1626d..c8a9853 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -9073,7 +9073,7 @@ access_attr_decl (gfc_statement st)
else
{
gfc_error ("Access specification of the .%s. operator at %C "
- "has already been specified", sym->name);
+ "has already been specified", uop->name);
goto done;
}
diff --git a/gcc/testsuite/gfortran.dg/pr95611.f90 b/gcc/testsuite/gfortran.dg/pr95611.f90
new file mode 100644
index 0000000..b7a5451
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95611.f90
@@ -0,0 +1,7 @@
+! { dg-do compile }
+! PR fortran/95611 - ICE in access_attr_decl, at fortran/decl.c:9075
+
+module m
+ public operator (.a.)
+ public operator (.a.) ! { dg-error "has already been specified" }
+end