aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2013-05-04 19:49:31 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2013-05-04 19:49:31 +0200
commit60f6ca95e03e5cfa9e3cdee37a7788b76d046e49 (patch)
treee0ffb0e77f85ef3fe7537349c4550d941169e096 /gcc/fortran/decl.c
parent0654e6be9566ff502a8754e3876c66dfdef14e2f (diff)
downloadgcc-60f6ca95e03e5cfa9e3cdee37a7788b76d046e49.zip
gcc-60f6ca95e03e5cfa9e3cdee37a7788b76d046e49.tar.gz
gcc-60f6ca95e03e5cfa9e3cdee37a7788b76d046e49.tar.bz2
decl.c (gfc_verify_c_interop_param): Permit allocatable and pointer with -std=f2008ts.
2013-05-04 Tobias Burnus <burnus@net-b.de> * decl.c (gfc_verify_c_interop_param): Permit allocatable and pointer with -std=f2008ts. 2013-05-04 Tobias Burnus <burnus@net-b.de> * gfortran.dg/bind_c_array_params.f03: Update dg-error. * gfortran.dg/bind_c_usage_27.f90: New. * gfortran.dg/bind_c_usage_28.f90: New. From-SVN: r198597
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index f9891c9..0187911 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -1061,20 +1061,27 @@ gfc_verify_c_interop_param (gfc_symbol *sym)
/* We have to make sure that any param to a bind(c) routine does
not have the allocatable, pointer, or optional attributes,
according to J3/04-007, section 5.1. */
- if (sym->attr.allocatable == 1)
- {
- gfc_error ("Variable '%s' at %L cannot have the "
- "ALLOCATABLE attribute because procedure '%s'"
- " is BIND(C)", sym->name, &(sym->declared_at),
- sym->ns->proc_name->name);
- retval = false;
- }
+ if (sym->attr.allocatable == 1
+ && !gfc_notify_std (GFC_STD_F2008_TS, "Variable '%s' at %L with "
+ "ALLOCATABLE attribute in procedure '%s' "
+ "with BIND(C)", sym->name,
+ &(sym->declared_at),
+ sym->ns->proc_name->name))
+ retval = false;
+
+ if (sym->attr.pointer == 1
+ && !gfc_notify_std (GFC_STD_F2008_TS, "Variable '%s' at %L with "
+ "POINTER attribute in procedure '%s' "
+ "with BIND(C)", sym->name,
+ &(sym->declared_at),
+ sym->ns->proc_name->name))
+ retval = false;
- if (sym->attr.pointer == 1)
+ if ((sym->attr.allocatable || sym->attr.pointer) && !sym->as)
{
- gfc_error ("Variable '%s' at %L cannot have the "
- "POINTER attribute because procedure '%s'"
- " is BIND(C)", sym->name, &(sym->declared_at),
+ gfc_error ("Scalar variable '%s' at %L with POINTER or "
+ "ALLOCATABLE in procedure '%s' with BIND(C) is not yet"
+ " supported", sym->name, &(sym->declared_at),
sym->ns->proc_name->name);
retval = false;
}