re PR fortran/68054 (ICE on using protected attribute in program without program statement)
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. From-SVN: r229542
This commit is contained in:
parent
730f6d1425
commit
721be0f47c
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
@ -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");
|
||||
|
@ -1,3 +1,8 @@
|
||||
2015-10-29 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
PR fortran/68054
|
||||
* gfortran.dg/pr68054.f90: New test.
|
||||
|
||||
2015-10-29 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
PR fortran/67885
|
||||
|
8
gcc/testsuite/gfortran.dg/pr68054.f90
Normal file
8
gcc/testsuite/gfortran.dg/pr68054.f90
Normal file
@ -0,0 +1,8 @@
|
||||
! { dg-do compile }
|
||||
! PR fortran/68054
|
||||
! Original code contributed by Gerhard Steinmetz
|
||||
! gerhard dot steinmetz dot fortran at t-online dot de
|
||||
!
|
||||
!program p
|
||||
real, protected :: x ! { dg-error "only allowed in specification" }
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user