aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2016-11-30 08:25:36 +0100
committerJanus Weil <janus@gcc.gnu.org>2016-11-30 08:25:36 +0100
commita4f15a7d4557811b8e5fef05a105cd68daa41a84 (patch)
tree1c783b11da296d9403057e202eb012b09db572d4 /gcc/fortran/decl.c
parenta195e177c07cf35bbb9f5194d85429935daa2f74 (diff)
downloadgcc-a4f15a7d4557811b8e5fef05a105cd68daa41a84.zip
gcc-a4f15a7d4557811b8e5fef05a105cd68daa41a84.tar.gz
gcc-a4f15a7d4557811b8e5fef05a105cd68daa41a84.tar.bz2
re PR fortran/78573 ([OOP] ICE in resolve_component, at fortran/resolve.c:13405)
2016-11-30 Janus Weil <janus@gcc.gnu.org> PR fortran/78573 * decl.c (build_struct): On error, return directly and do not build class symbol. 2016-11-30 Janus Weil <janus@gcc.gnu.org> PR fortran/78573 * gfortran.dg/class_61.f90: New test case. From-SVN: r242996
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 21eaafe..411d496d 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -1850,7 +1850,6 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
{
gfc_state_data *s;
gfc_component *c;
- bool t = true;
/* F03:C438/C439. If the current symbol is of the same derived type that we're
constructing, it must have the pointer attribute. */
@@ -1952,7 +1951,7 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
{
gfc_error ("Pointer array component of structure at %C must have a "
"deferred shape");
- t = false;
+ return false;
}
}
else if (c->attr.allocatable)
@@ -1961,7 +1960,7 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
{
gfc_error ("Allocatable component of structure at %C must have a "
"deferred shape");
- t = false;
+ return false;
}
}
else
@@ -1970,20 +1969,15 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
{
gfc_error ("Array component of structure at %C must have an "
"explicit shape");
- t = false;
+ return false;
}
}
scalar:
if (c->ts.type == BT_CLASS)
- {
- bool t2 = gfc_build_class_symbol (&c->ts, &c->attr, &c->as);
+ return gfc_build_class_symbol (&c->ts, &c->attr, &c->as);
- if (t)
- t = t2;
- }
-
- return t;
+ return true;
}