diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2012-01-21 17:32:12 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2012-01-21 17:32:12 +0000 |
commit | bb3a6981bf23bebe7a602a5416ee7f52afed9052 (patch) | |
tree | 991b80e5b545a3f5ce82adbc0a4a7f549d20e409 /gcc | |
parent | 076ec830bf9d00dfa216beb88fb7d58650fbfbc1 (diff) | |
download | gcc-bb3a6981bf23bebe7a602a5416ee7f52afed9052.zip gcc-bb3a6981bf23bebe7a602a5416ee7f52afed9052.tar.gz gcc-bb3a6981bf23bebe7a602a5416ee7f52afed9052.tar.bz2 |
[multiple changes]
2012-01-21 Tobias Burnus <burnus@net-b.de>
Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/50556
* symbol.c (check_conflict): namelist-group-name cannot have the SAVE
attribure.
2012-01-21 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/50556
* gfortran.dg/namelist_74.f90: New test.
* gfortran.dg/namelist_59.f90: Remove SAVE attribute.
From-SVN: r183370
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/symbol.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/namelist_59.f90 | 1 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/namelist_74.f90 | 10 |
5 files changed, 28 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index bff42e5..85aaa21 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,4 +1,11 @@ 2012-01-21 Tobias Burnus <burnus@net-b.de> + Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/50556 + * symbol.c (check_conflict): namelist-group-name cannot have the SAVE + attribure. + +2012-01-21 Tobias Burnus <burnus@net-b.de> PR fortran/51913 * interface.c (compare_parameter): Fix CLASS comparison. diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index fcc1ccf..36fc1ed 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -444,12 +444,15 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) a1 = gfc_code2string (flavors, attr->flavor); a2 = save; goto conflict; - + case FL_NAMELIST: + gfc_error ("Namelist group name at %L cannot have the " + "SAVE attribute", where); + return FAILURE; + break; case FL_PROCEDURE: /* Conflicts between SAVE and PROCEDURE will be checked at resolution stage, see "resolve_fl_procedure". */ case FL_VARIABLE: - case FL_NAMELIST: default: break; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 81597d2..5131389 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2012-01-21 Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/50556 + * gfortran.dg/namelist_74.f90: New test. + * gfortran.dg/namelist_59.f90: Remove SAVE attribute. + 2012-01-21 Tobias Burnus <burnus@net-b.de> PR fortran/51913 diff --git a/gcc/testsuite/gfortran.dg/namelist_59.f90 b/gcc/testsuite/gfortran.dg/namelist_59.f90 index bb68b9b..f69a49a 100644 --- a/gcc/testsuite/gfortran.dg/namelist_59.f90 +++ b/gcc/testsuite/gfortran.dg/namelist_59.f90 @@ -16,7 +16,6 @@ subroutine process(string) integer :: i=1,j=2,k=3 integer ios namelist /cmd/ i,j,k - save cmd lines(1)='&cmd' lines(2)=string lines(3)='/' diff --git a/gcc/testsuite/gfortran.dg/namelist_74.f90 b/gcc/testsuite/gfortran.dg/namelist_74.f90 new file mode 100644 index 0000000..520c7ab --- /dev/null +++ b/gcc/testsuite/gfortran.dg/namelist_74.f90 @@ -0,0 +1,10 @@ +! { dg-do compile } +! PR fortran/50556 +subroutine foo + save i + namelist /i/ ii ! { dg-error "cannot have the SAVE attribute" } +end subroutine foo +subroutine bar + namelist /i/ ii + save i ! { dg-error "cannot have the SAVE attribute" } +end subroutine bar |