https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104332
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #2 from kargl at gcc dot gnu.org ---
(In reply to G. Steinmetz from comment #1)
> Note that this addition gives an ICE down to at least r5 for some reasons :
>
> $ cat z3.f90
> block data
> real, bind(c) :: a
> end block data
This is fixed by
diff --git a/gcc/fortran/symbol.cc b/gcc/fortran/symbol.cc
index 7a80dfd063b..8f9a2bb4d95 100644
--- a/gcc/fortran/symbol.cc
+++ b/gcc/fortran/symbol.cc
@@ -481,6 +481,9 @@ gfc_check_conflict (symbol_attribute *attr, const char
*name, locus *where)
a1 = publik;
if (attr->intent != INTENT_UNKNOWN)
a1 = intent;
+ /* F2018:C1416. */
+ if (attr->is_bind_c != INTENT_UNKNOWN)
+ a1 = is_bind_c;
if (a1 != NULL)
{
But, I think that there are conflicts in the Fortran standard.
Are these code snippets equivalent?
BLOCK DATA
BIND(C) :: A
END BLOCK DATA
BLOCK DATA
REAL :: A
BIND(C) :: A
END BLOCK DATA
BLOCK DATA
REAL, BIND(C) :: A
END BLOCK DATA
If yes, do C1415 and C1416 conflict?
C1415 (R1420) A block-data specification-part shall contain
only derived-type definitions and ..., BIND, ..., and
type declaration statements.
C1416 (R1420) A type declaration statement in a block-data
specification-part shall not contain ALLOCATABLE, EXTERNAL,
or BIND attribute specifiers.
In fact, does C1415 conflict with C819?
C819 A variable with the BIND attribute shall be declared in
the specification part of a module.