re PR fortran/33412 (Bind(C): ELEMENTAL procedure conflicts with BIND(C))
authorTobias Burnus <burnus@net-b.de>
Thu, 13 Sep 2007 17:58:10 +0000 (19:58 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Thu, 13 Sep 2007 17:58:10 +0000 (19:58 +0200)
2007-09-13  Tobias Burnus  <burnus@net-b.de>

PR fortran/33412
* symbol.c (check_conflict): Add conflict of ELEMENTAL with Bind(C).

2007-09-13  Tobias Burnus  <burnus@net-b.de>

PR fortran/33412
* gfortran.dg/elemental_bind_c.f90: New.

From-SVN: r128471

gcc/fortran/ChangeLog
gcc/fortran/symbol.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/elemental_bind_c.f90 [new file with mode: 0644]

index 6a5914bdea1ed79dfeffc859373b7661e08e688b..0b1eca4e5829a185629dd132b4ab422c22f888a8 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-13  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/33412
+       * symbol.c (check_conflict): Add conflict of ELEMENTAL with Bind(C).
+
 2007-09-12  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/33297
index c41235de79981f8c3b49243e42fabd84acf72d98..01f64e277ed5ad461f2586316520381dd92707de 100644 (file)
@@ -480,6 +480,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
   conf (is_bind_c, cray_pointer);
   conf (is_bind_c, cray_pointee);
   conf (is_bind_c, allocatable);
+  conf (is_bind_c, elemental);
 
   /* Need to also get volatile attr, according to 5.1 of F2003 draft.
      Parameter conflict caught below.  Also, value cannot be specified
index 34af18c43b8beadaa1426fd57eaaca27fe8aef89..fd4a00cb299e3515fe6d2d1959eefae87ecdfcba 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-13  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/33412
+       * gfortran.dg/elemental_bind_c.f90: New.
+
 2007-09-13  Richard Sandiford  <richard@codesourcery.com>
 
        * gcc.dg/gcc-have-sync-compare-and-swap.c: Skip for -mflip-mips16.
diff --git a/gcc/testsuite/gfortran.dg/elemental_bind_c.f90 b/gcc/testsuite/gfortran.dg/elemental_bind_c.f90
new file mode 100644 (file)
index 0000000..d61b497
--- /dev/null
@@ -0,0 +1,10 @@
+! {dg-do compile }
+!
+! PR fortran/33412
+!
+elemental subroutine a() bind(c) ! { dg-error "BIND.C. attribute conflicts with ELEMENTAL" }
+end subroutine a ! { dg-error "Expecting END PROGRAM" }
+
+elemental function b() bind(c) ! { dg-error "BIND.C. attribute conflicts with ELEMENTAL" }
+end function b ! { dg-error "Expecting END PROGRAM" }
+end