From: Harald Anlauf Date: Thu, 11 Jun 2020 19:03:48 +0000 (+0200) Subject: PR fortran/95611 - ICE in access_attr_decl, at fortran/decl.c:9075 X-Git-Tag: releases/gcc-10.2.0~239 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b9a3b484f7c89bc5064bf32ecfa2b4aee218d5f;p=thirdparty%2Fgcc.git 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 gcc/fortran/ PR fortran/95611 * decl.c (access_attr_decl): Use correct symbol in error message. Co-Authored-By: Steven G. Kargl (cherry picked from commit 393ccb72566dc004b9ab5c3b8fb6fdca6c095812) --- diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index bcc850e9130c..1b3a0898d99e 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -9058,7 +9058,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 000000000000..b7a54514ca3c --- /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