From a1dde7d41c18eccd347c996c282423a6b0056efd Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Wed, 12 Sep 2007 12:27:27 +0200 Subject: [PATCH] re PR fortran/33284 (ENTRY and INTRINSIC with same name) 2007-09-12 Tobias Burnus PR fortran/33284 PR fortran/33310 * symbol.c (check_conflict): Add conflict between INTRINSIC and ENTRY and between BIND(C) and PARAMETER. 2007-09-12 Tobias Burnus PR fortran/33284 PR fortran/33310 * gfortran.dg/conflicts_2.f90: New. From-SVN: r128423 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/symbol.c | 3 ++- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gfortran.dg/conflicts_2.f90 | 25 +++++++++++++++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/conflicts_2.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f16d66710df..e726660f242 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2007-09-12 Tobias Burnus + + PR fortran/33284 + PR fortran/33310 + * symbol.c (check_conflict): Add conflict between INTRINSIC and ENTRY + and between BIND(C) and PARAMETER. + 2007-09-12 Tobias Burnus * trans-expr.c (gfc_conv_initializer): Fix expr == NULL check. diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 69a675b93d0..c41235de799 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -437,6 +437,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) conf (external, dimension); /* See Fortran 95's R504. */ conf (external, intrinsic); + conf (entry, intrinsic); if ((attr->if_source && !attr->procedure) || attr->contained) { @@ -673,8 +674,8 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) conf2 (value); conf2 (volatile_); conf2 (threadprivate); - /* TODO: hmm, double check this. */ conf2 (value); + conf2 (is_bind_c); break; default: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cce7b21c2e4..f1bf054068b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2007-09-12 Tobias Burnus + + PR fortran/33284 + PR fortran/33310 + * gfortran.dg/conflicts_2.f90: New. + 2007-09-12 Ira Rosen PR tree-optimization/32377 diff --git a/gcc/testsuite/gfortran.dg/conflicts_2.f90 b/gcc/testsuite/gfortran.dg/conflicts_2.f90 new file mode 100644 index 00000000000..665667294d9 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/conflicts_2.f90 @@ -0,0 +1,25 @@ +! { dg-do compile } +! +! Check conflicts: +! - PARAMETER and BIND(C), PR fortran/33310 +! - INTRINSIC and ENTRY, PR fortran/33284 +! + +subroutine a + intrinsic cos +entry cos(x) ! { dg-error "ENTRY attribute conflicts with INTRINSIC" } + real x + x = 0 +end subroutine + +module m + use iso_c_binding + implicit none + TYPE, bind(C) :: the_distribution + INTEGER(c_int) :: parameters(1) + END TYPE the_distribution + TYPE (the_distribution), parameter, bind(C) :: & ! { dg-error "PARAMETER attribute conflicts with BIND.C." } + the_beta = the_distribution((/0/)) +end module m + +end -- 2.30.2