aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2006-10-13 12:51:07 +0000
committerPaul Thomas <pault@gcc.gnu.org>2006-10-13 12:51:07 +0000
commit982186b1be20337cd4101495a9b0cbab937fd74f (patch)
tree1d53d33e42e171e630c8781c3fdee5e851cb8967 /gcc/fortran/decl.c
parentac677cc88956d8b2022022610eb79112136267f3 (diff)
downloadgcc-982186b1be20337cd4101495a9b0cbab937fd74f.zip
gcc-982186b1be20337cd4101495a9b0cbab937fd74f.tar.gz
gcc-982186b1be20337cd4101495a9b0cbab937fd74f.tar.bz2
re PR fortran/29373 (implicit type declaration and contained function clash)
2006-10-13 Paul Thomas <pault@gcc.gnu.org> PR fortran/29373 * decl.c (get_proc_name, gfc_match_function_decl): Add attr.implicit_type to conditions that throw error for existing explicit interface and that allow new type- spec to be applied. PR fortran/29407 * resolve.c (resolve_fl_namelist): Do not check for namelist/procedure conflict, if the symbol corresponds to a good local variable declaration. PR fortran/27701 * decl.c (get_proc_name): Replace the detection of a declared procedure by the presence of a formal argument list by the attributes of the symbol and the presence of an explicit interface. PR fortran/29232 * resolve.c (resolve_fl_variable): See if the host association of a derived type is blocked by the presence of another type I object in the current namespace. PR fortran/29364 * resolve.c (resolve_fl_derived): Check for the presence of the derived type for a derived type component. PR fortran/24398 * module.c (gfc_use_module): Check that the first words in a module file are 'GFORTRAN module'. PR fortran/29422 * resolve.c (resolve_transfer): Test functions for suitability for IO, as well as variables. PR fortran/29428 * trans-expr.c (gfc_trans_scalar_assign): Remove nullify of rhs expression. 2006-10-13 Paul Thomas <pault@gcc.gnu.org> PR fortran/29373 * gfortran.dg/implicit_9.f90: New test. PR fortran/29407 * gfortran.dg/namelist_25.f90: New test. PR fortran/27701 * gfortran.dg/same_name_2.f90: New test. PR fortran/29232 * gfortran.dg/host_assoc_types_1.f90: New test. PR fortran/29364 * gfortran.dg/missing_derived_type_1.f90: New test. * gfortran.dg/implicit_actual.f90: Comment out USE GLOBAL. PR fortran/29422 * gfortran.dg/alloc_comp_constraint_4.f90: New test. PR fortran/29428 * gfortran.dg/alloc_comp_assign_5.f90: New test. From-SVN: r117692
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index a9a11c0..02dc38c 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -635,7 +635,8 @@ get_proc_name (const char *name, gfc_symbol ** result,
accessible names. */
if (sym->attr.flavor != 0
&& sym->attr.proc != 0
- && sym->formal)
+ && (sym->attr.subroutine || sym->attr.function)
+ && sym->attr.if_source != IFSRC_UNKNOWN)
gfc_error_now ("Procedure '%s' at %C is already defined at %L",
name, &sym->declared_at);
@@ -643,6 +644,7 @@ get_proc_name (const char *name, gfc_symbol ** result,
signature for this is that ts.kind is set. Legitimate
references only set ts.type. */
if (sym->ts.kind != 0
+ && !sym->attr.implicit_type
&& sym->attr.proc == 0
&& gfc_current_ns->parent != NULL
&& sym->attr.access == 0
@@ -2679,7 +2681,9 @@ gfc_match_function_decl (void)
|| copy_prefix (&sym->attr, &sym->declared_at) == FAILURE)
goto cleanup;
- if (current_ts.type != BT_UNKNOWN && sym->ts.type != BT_UNKNOWN)
+ if (current_ts.type != BT_UNKNOWN
+ && sym->ts.type != BT_UNKNOWN
+ && !sym->attr.implicit_type)
{
gfc_error ("Function '%s' at %C already has a type of %s", name,
gfc_basic_typename (sym->ts.type));