From 01efe923a3e625157653652d13c15836bb3a8c41 Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Mon, 14 Feb 2011 23:17:44 +0100 Subject: [PATCH] re PR fortran/47730 ([OOP] ICE on invalid source in connection with SELECT TYPE) 2011-02-14 Janus Weil PR fortran/47730 * parse.c (gfc_build_block_ns): Commit 'block@' symbol. 2011-02-14 Janus Weil PR fortran/47730 * gfortran.dg/select_type_22.f03: New. From-SVN: r170157 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/parse.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/select_type_22.f03 | 17 +++++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/select_type_22.f03 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index db0069ea4e6..8b4f63f6097 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2011-02-14 Janus Weil + + PR fortran/47730 + * parse.c (gfc_build_block_ns): Commit 'block@' symbol. + 2011-02-14 Janus Weil PR fortran/47728 diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index b51e12bee46..7fc3dca43be 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -3154,6 +3154,7 @@ gfc_build_block_ns (gfc_namespace *parent_ns) t = gfc_add_flavor (&my_ns->proc_name->attr, FL_LABEL, my_ns->proc_name->name, NULL); gcc_assert (t == SUCCESS); + gfc_commit_symbol (my_ns->proc_name); } if (parent_ns->proc_name) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cd73643e916..3d21c833960 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-02-14 Janus Weil + + PR fortran/47730 + * gfortran.dg/select_type_22.f03: New. + 2011-02-14 Jason Merrill * g++.dg/cpp0x/regress/enum1.C: New. diff --git a/gcc/testsuite/gfortran.dg/select_type_22.f03 b/gcc/testsuite/gfortran.dg/select_type_22.f03 new file mode 100644 index 00000000000..68d2ff6a169 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/select_type_22.f03 @@ -0,0 +1,17 @@ +! { dg-do compile } +! +! PR 47330: [OOP] ICE on invalid source in connection with SELECT TYPE +! +! Contributed by Andrew Benson + + type treeNode + end type +contains + subroutine proc1 (thisNode) + class (treeNode), target :: thisNode + select type (thisNode) + type is (treeNode) + workNode => thisNode ! { dg-error "Non-POINTER in pointer association context" } + end select + end subroutine +end -- 2.30.2