Error on Associate with a program.
2018-12-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/92780 * resolve.c (resolve_assoc_var): Issue error if the associating entity is a program. 2018-12-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/92780 * gfortran.dg/associate_50.f90: New test. From-SVN: r279088
This commit is contained in:
parent
f477062c2e
commit
c212316b4a
@ -1,3 +1,9 @@
|
||||
2018-12-08 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/92780
|
||||
* resolve.c (resolve_assoc_var): Issue error if the associating
|
||||
entity is a program.
|
||||
|
||||
2018-12-08 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/92764
|
||||
|
@ -8842,6 +8842,12 @@ resolve_assoc_var (gfc_symbol* sym, bool resolve_target)
|
||||
|
||||
gcc_assert (target->symtree);
|
||||
tsym = target->symtree->n.sym;
|
||||
if (tsym->attr.flavor == FL_PROGRAM)
|
||||
{
|
||||
gfc_error ("Associating entity %qs at %L is a PROGRAM",
|
||||
tsym->name, &target->where);
|
||||
return;
|
||||
}
|
||||
|
||||
sym->attr.asynchronous = tsym->attr.asynchronous;
|
||||
sym->attr.volatile_ = tsym->attr.volatile_;
|
||||
|
@ -1,3 +1,8 @@
|
||||
2018-12-08 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/92780
|
||||
* gfortran.dg/associate_50.f90: New test.
|
||||
|
||||
2018-12-08 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/92764
|
||||
|
8
gcc/testsuite/gfortran.dg/associate_50.f90
Normal file
8
gcc/testsuite/gfortran.dg/associate_50.f90
Normal file
@ -0,0 +1,8 @@
|
||||
! { dg-do compile }
|
||||
! PR 92780 - this used to ICE instead of being rejected.
|
||||
! Test case by Gerhard Steinmetz.
|
||||
|
||||
program p
|
||||
associate (y => p) ! { dg-error "is a PROGRAM" }
|
||||
end associate
|
||||
end program p
|
Loading…
Reference in New Issue
Block a user