aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2011-05-06 20:12:25 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2011-05-06 20:12:25 +0200
commit2e8d9212daaa8c6162ab872485dd03d28c96ea4c (patch)
tree0b573a6cdfb20f51178b705ea9d49570cd795302 /gcc/fortran/decl.c
parent80bde45b083facc3f141c29c8c71d38619b1d9cb (diff)
downloadgcc-2e8d9212daaa8c6162ab872485dd03d28c96ea4c.zip
gcc-2e8d9212daaa8c6162ab872485dd03d28c96ea4c.tar.gz
gcc-2e8d9212daaa8c6162ab872485dd03d28c96ea4c.tar.bz2
re PR fortran/48858 (Incorrect error for same binding label on two generic interface specifics)
2011-05-06 Tobias Burnus <burnus@net-b.de> PR fortran/48858 PR fortran/48820 * lang.opt (std=f2008tr): New. * libgfortran.h (GFC_STD_F2008_TR): New macro constant. * decl.c (verify_c_interop_param): Allow OPTIONAL in BIND(C) procedures for -std=f2008tr/gnu/legacy. 2011-05-06 Tobias Burnus <burnus@net-b.de> PR fortran/48858 PR fortran/48820 * gfortran.dg/bind_c_usage_22.f90: New. * gfortran.dg/bind_c_usage_23.f90: New. * gfortran.dg/bind_c_usage_24.f90: New. * gfortran.dg/bind_c_usage_24_c.c: New. From-SVN: r173500
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index dfbca29a..8acd594 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -1060,14 +1060,22 @@ verify_c_interop_param (gfc_symbol *sym)
retval = FAILURE;
}
- if (sym->attr.optional == 1)
+ if (sym->attr.optional == 1 && sym->attr.value)
{
- gfc_error ("Variable '%s' at %L cannot have the "
- "OPTIONAL attribute because procedure '%s'"
- " is BIND(C)", sym->name, &(sym->declared_at),
+ gfc_error ("Variable '%s' at %L cannot have both the OPTIONAL "
+ "and the VALUE attribute because procedure '%s' "
+ "is BIND(C)", sym->name, &(sym->declared_at),
sym->ns->proc_name->name);
retval = FAILURE;
}
+ else if (sym->attr.optional == 1
+ && gfc_notify_std (GFC_STD_F2008_TR, "TR29113: Variable '%s' "
+ "at %L with OPTIONAL attribute in "
+ "procedure '%s' which is BIND(C)",
+ sym->name, &(sym->declared_at),
+ sym->ns->proc_name->name)
+ == FAILURE)
+ retval = FAILURE;
/* Make sure that if it has the dimension attribute, that it is
either assumed size or explicit shape. */
@@ -2985,6 +2993,7 @@ gfc_match_import (void)
for(;;)
{
+ sym = NULL;
m = gfc_match (" %n", name);
switch (m)
{