aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2009-10-10 00:35:11 +0200
committerJanus Weil <janus@gcc.gnu.org>2009-10-10 00:35:11 +0200
commit619dd721d92a231cb82c709547d85c5cdf90a99e (patch)
treed1853222b9d57e9be22189a4b107eecbeca28744 /gcc/fortran/decl.c
parente9e4b3a892d0d19418f23bb17bdeac33f9a8bfd2 (diff)
downloadgcc-619dd721d92a231cb82c709547d85c5cdf90a99e.zip
gcc-619dd721d92a231cb82c709547d85c5cdf90a99e.tar.gz
gcc-619dd721d92a231cb82c709547d85c5cdf90a99e.tar.bz2
re PR fortran/41585 ([OOP] Reject CLASS(T) as component of "TYPE :: T")
2009-10-09 Janus Weil <janus@gcc.gnu.org> PR fortran/41585 * decl.c (build_struct): Bugfix for CLASS components. 2009-10-09 Janus Weil <janus@gcc.gnu.org> PR fortran/41585 * gfortran.dg/class_2.f03: Extended test case. From-SVN: r152608
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 2c378fb..1856d89 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -1464,9 +1464,9 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
{
gfc_component *c;
- /* If the current symbol is of the same derived type that we're
+ /* F03:C438/C439. If the current symbol is of the same derived type that we're
constructing, it must have the pointer attribute. */
- if (current_ts.type == BT_DERIVED
+ if ((current_ts.type == BT_DERIVED || current_ts.type == BT_CLASS)
&& current_ts.u.derived == gfc_current_block ()
&& current_attr.pointer == 0)
{