summaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-29 17:23:52 +0000
committerkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-29 17:23:52 +0000
commit8371b2e9d074a51fd7bd5a44d73244e233166cfb (patch)
treeae4fa32ce8f0b772d60ee73ba7796e58e8bfb990 /gcc/fortran
parent09e5769840d85ea7a5b64f1804b7104d6abb4c9d (diff)
downloadgcc-8371b2e9d074a51fd7bd5a44d73244e233166cfb.tar.gz
2015-10-29 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/68054 * decl.c (match_attr_spec): PROTECTED can only be a module. 2015-10-29 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/68054 * gfortran.dg/pr68054.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229542 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/decl.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 5aed4bdde88..587045d0579 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,10 @@
2015-10-29 Steven G. Kargl <kargl@gcc.gnu.org>
+ PR fortran/68054
+ * decl.c (match_attr_spec): PROTECTED can only be a module.
+
+2015-10-29 Steven G. Kargl <kargl@gcc.gnu.org>
+
PR fortran/67885
* trans-decl.c (generate_local_decl): Mark PARAMETER entities in
BLOCK construct.
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 5c34dc94387..6a7f3864ded 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -3959,7 +3959,9 @@ match_attr_spec (void)
break;
case DECL_PROTECTED:
- if (gfc_current_ns->proc_name->attr.flavor != FL_MODULE)
+ if (gfc_current_state () != COMP_MODULE
+ || (gfc_current_ns->proc_name
+ && gfc_current_ns->proc_name->attr.flavor != FL_MODULE))
{
gfc_error ("PROTECTED at %C only allowed in specification "
"part of a module");