:ADDPATCH fortran:
currently, one can write:
program test
volatile :: test
which does not make much sense.
Added patch adds conf(volatile_) to:
case FL_PROGRAM:
case FL_BLOCK_DATA:
case FL_MODULE:
case FL_LABEL:
Ok for the trunk?
Regtested on x86_64-unknown-linux-gnu
Tobias
------------------------------------------------------------------------
fortran/
2006-11-20 Tobias Burnus <burnus@net-b.de>
* symbol.c (check_conflict): Add conflict between VOLATILE
attribute and program name.
testsuite/
2006-11-20 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/volatile3.f90: Add conflict test.
Index: gcc/fortran/symbol.c
===================================================================
*** gcc/fortran/symbol.c (Revision 119016)
--- gcc/fortran/symbol.c (Arbeitskopie)
*************** check_conflict (symbol_attribute * attr,
*** 432,437 ****
--- 448,454 ----
conf2 (dimension);
conf2 (dummy);
conf2 (save);
+ conf2 (volatile_);
conf2 (pointer);
conf2 (target);
conf2 (external);
Index: gcc/testsuite/gfortran.dg/volatile3.f90
===================================================================
*** gcc/testsuite/gfortran.dg/volatile3.f90 (Revision 119016)
--- gcc/testsuite/gfortran.dg/volatile3.f90 (Arbeitskopie)
*************** program volatile_test
*** 13,18 ****
--- 13,19 ----
real, volatile,volatile :: r = 3. ! { dg-error "Duplicate VOLATILE attribute" }
volatile :: l,n ! { dg-error "Duplicate VOLATILE attribute" }
volatile ! { dg-error "Syntax error in VOLATILE statement" }
+ volatile :: volatile_test ! { dg-error "PROGRAM attribute conflicts with VOLATILE attribute" }
l = 4.0
m = 3.0
contains