diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2019-11-10 18:33:00 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2019-11-10 18:33:00 +0000 |
commit | 0313a84a2faa8f685eb489fa787f1ea969f68560 (patch) | |
tree | 3f4a01ea876388bd1334b361f0a96304fc93ff8b /gcc/fortran/decl.c | |
parent | 4b77a3806c4f2e27d149da326a689286043e433c (diff) | |
download | gcc-0313a84a2faa8f685eb489fa787f1ea969f68560.zip gcc-0313a84a2faa8f685eb489fa787f1ea969f68560.tar.gz gcc-0313a84a2faa8f685eb489fa787f1ea969f68560.tar.bz2 |
re PR fortran/92123 ([F2018/array-descriptor] Scalar allocatable/pointer with array descriptor (via bind(C)): ICE with select rank or error scalar variable with POINTER or ALLOCATABLE in procedure with BIND(C) is not yet supported)
2019-11-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/92123
*decl.c (gfc_verify_c_interop_param): Remove error asserting
that pointer or allocatable variables in a bind C procedure are
not supported. Delete some trailing spaces.
* trans-stmt.c (trans_associate_var): Correct the attempt to
treat scalar pointer or allocatable temporaries as if they are
array descriptors.
2019-11-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/92123
* gfortran.dg/bind_c_procs_3.f90 : New test.
* gfortran.dg/ISO_Fortran_binding_15.c : New test.
* gfortran.dg/ISO_Fortran_binding_15.f90 : Additional source.
From-SVN: r278025
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 7858973..affdbf6 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -1560,15 +1560,6 @@ gfc_verify_c_interop_param (gfc_symbol *sym) sym->ns->proc_name->name)) retval = false; - if ((sym->attr.allocatable || sym->attr.pointer) && !sym->as) - { - gfc_error ("Scalar variable %qs at %L with POINTER or " - "ALLOCATABLE in procedure %qs with BIND(C) is not yet" - " supported", sym->name, &(sym->declared_at), - sym->ns->proc_name->name); - retval = false; - } - if (sym->attr.optional == 1 && sym->attr.value) { gfc_error ("Variable %qs at %L cannot have both the OPTIONAL " @@ -7567,7 +7558,7 @@ gfc_match_entry (void) entry->attr.is_bind_c = 0; loc = entry->old_symbol != NULL - ? entry->old_symbol->declared_at : gfc_current_locus; + ? entry->old_symbol->declared_at : gfc_current_locus; gfc_error_now ("BIND(C) attribute at %L can only be used for " "variables or common blocks", &loc); } @@ -10313,7 +10304,7 @@ gfc_match_derived_decl (void) } /* In free source form, need to check for TYPE XXX as oppose to TYPEXXX. - But, we need to simply return for TYPE(. */ + But, we need to simply return for TYPE(. */ if (m == MATCH_NO && gfc_current_form == FORM_FREE) { char c = gfc_peek_ascii_char (); |