https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79685
anlauf at gcc dot gnu.org changed:
What|Removed |Added
CC||anlauf at gcc dot gnu.org
--- Comment #11 from anlauf at gcc dot gnu.org ---
The following tentative change fixes testcase z1 in comment#5:
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index 3f01f67cd49..d3729b20446 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -3373,8 +3373,8 @@ gfc_match_structure_constructor (gfc_symbol *sym,
gfc_expr **result)
e->expr_type = EXPR_FUNCTION;
e->where = gfc_current_locus;
- gcc_assert (gfc_fl_struct (sym->attr.flavor)
- && symtree->n.sym->attr.flavor == FL_PROCEDURE);
+ gcc_assert (gfc_fl_struct (sym->attr.flavor));
+// && symtree->n.sym->attr.flavor == FL_PROCEDURE);
e->value.function.esym = sym;
e->symtree->n.sym->attr.generic = 1;
However, it does not fix the example in comment#0.
Playing a little, it seems that commenting the "implicit none" in module foo
then lets the code compile.
Alternative reproducer:
module m
implicit none
private
public :: t
type t
integer :: i
end type
end
module m2
use m, t2 => t
implicit none ! <--- Error: Symbol 't' at (1) has no IMPLICIT type
private
type(t2), public, protected :: x(2)
data x(1) /t2(3)/
end
program p
use m2
implicit none
print *, x(1)%i
end program p
So there is more to it...