https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68568
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anlauf at gcc dot gnu.org
--- Comment #8 from anlauf at gcc dot gnu.org ---
I'm testing the following (almost obvious) fix:
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index 9fe8d1ee20c..56a78d6f89f 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -2779,7 +2779,7 @@ gfc_expr_attr (gfc_expr *e)
&& e->value.function.isym->transformational
&& e->ts.type == BT_CLASS)
attr = CLASS_DATA (e)->attr;
- else
+ else if (e->symtree)
attr = gfc_variable_attr (e, NULL);
/* TODO: NULL() returns pointers. May have to take care of this