diff options
author | Tobias Burnus <burnus@net-b.de> | 2012-07-20 22:15:59 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2012-07-20 22:15:59 +0200 |
commit | 95d47b8dbceac322d91aafce5b30c013e0366642 (patch) | |
tree | 0bacb7035795e576dbadde0bd51bd2737e46847e /gcc/fortran/decl.c | |
parent | 5d8c54a731b5ea98c5f2a64bb963a8a4663a21db (diff) | |
download | gcc-95d47b8dbceac322d91aafce5b30c013e0366642.zip gcc-95d47b8dbceac322d91aafce5b30c013e0366642.tar.gz gcc-95d47b8dbceac322d91aafce5b30c013e0366642.tar.bz2 |
decl.c (gfc_verify_c_interop_param): Allow assumed-shape with -std=f2008ts.
2012-07-20 Tobias Burnus <burnus@net-b.de>
* decl.c (gfc_verify_c_interop_param): Allow assumed-shape
with -std=f2008ts.
2012-07-20 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/bind_c_array_params_2.f90: New.
* gfortran.dg/bind_c_array_params.f03: Add -std=f2003
and update dg-error.
From-SVN: r189726
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 66e2ca8..28e5a5b 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -1095,29 +1095,15 @@ gfc_verify_c_interop_param (gfc_symbol *sym) retval = FAILURE; /* Make sure that if it has the dimension attribute, that it is - either assumed size or explicit shape. */ - if (sym->as != NULL) - { - if (sym->as->type == AS_ASSUMED_SHAPE) - { - gfc_error ("Assumed-shape array '%s' at %L cannot be an " - "argument to the procedure '%s' at %L because " - "the procedure is BIND(C)", sym->name, - &(sym->declared_at), sym->ns->proc_name->name, - &(sym->ns->proc_name->declared_at)); - retval = FAILURE; - } - - if (sym->as->type == AS_DEFERRED) - { - gfc_error ("Deferred-shape array '%s' at %L cannot be an " - "argument to the procedure '%s' at %L because " - "the procedure is BIND(C)", sym->name, - &(sym->declared_at), sym->ns->proc_name->name, - &(sym->ns->proc_name->declared_at)); - retval = FAILURE; - } - } + either assumed size or explicit shape. Deferred shape is already + covered by the pointer/allocatable attribute. */ + if (sym->as != NULL && sym->as->type == AS_ASSUMED_SHAPE + && gfc_notify_std (GFC_STD_F2008_TS, "Assumed-shape array '%s' " + "at %L as dummy argument to the BIND(C) " + "procedure '%s' at %L", sym->name, + &(sym->declared_at), sym->ns->proc_name->name, + &(sym->ns->proc_name->declared_at)) == FAILURE) + retval = FAILURE; } } |