diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2006-07-13 05:07:35 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2006-07-13 05:07:35 +0000 |
commit | 72af9f0b517b8dec055f72bf2ba7bfcb2e8da99b (patch) | |
tree | 677273f32ea31a251f8e44292ca967e69e8d4e7b /gcc/fortran/decl.c | |
parent | 3fb8727b3b054dbb2c934baf33bb8946eeb3fae1 (diff) | |
download | gcc-72af9f0b517b8dec055f72bf2ba7bfcb2e8da99b.zip gcc-72af9f0b517b8dec055f72bf2ba7bfcb2e8da99b.tar.gz gcc-72af9f0b517b8dec055f72bf2ba7bfcb2e8da99b.tar.bz2 |
re PR fortran/28174 (Corruption of multiple character arrays when passing array sections)
2006-07-13 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28174
* trans-expr.c (gfc_conv_aliased_arg): Missing formal arg means
that intent is INOUT (fixes regression).
PR fortran/25097
* check.c (check_present): The only permitted reference is a
full array reference.
PR fortran/20903
* decl.c (variable_decl): Add error if a derived type is not
from the current namespace if the namespace is an interface
body.
2006-07-13 Paul Thomas <pault@gcc.gnu.org>
PR fortran/25097
* gfortran.dg/present_1.f90: New test.
PR fortran/20903
* gfortran.dg/interface_derived_type_1.f90: New test.
From-SVN: r115410
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 5eca35d..fb980d6 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -1176,6 +1176,20 @@ variable_decl (int elem) goto cleanup; } + /* An interface body specifies all of the procedure's characteristics and these + shall be consistent with those specified in the procedure definition, except + that the interface may specify a procedure that is not pure if the procedure + is defined to be pure(12.3.2). */ + if (current_ts.type == BT_DERIVED + && gfc_current_ns->proc_name->attr.if_source == IFSRC_IFBODY + && current_ts.derived->ns != gfc_current_ns) + { + gfc_error ("the type of '%s' at %C has not been declared within the " + "interface", name); + m = MATCH_ERROR; + goto cleanup; + } + /* In functions that have a RESULT variable defined, the function name always refers to function calls. Therefore, the name is not allowed to appear in specification statements. */ |