re PR fortran/47730 ([OOP] ICE on invalid source in connection with SELECT TYPE)
authorJanus Weil <janus@gcc.gnu.org>
Mon, 14 Feb 2011 22:17:44 +0000 (23:17 +0100)
committerJanus Weil <janus@gcc.gnu.org>
Mon, 14 Feb 2011 22:17:44 +0000 (23:17 +0100)
2011-02-14  Janus Weil  <janus@gcc.gnu.org>

PR fortran/47730
* parse.c (gfc_build_block_ns): Commit 'block@' symbol.

2011-02-14  Janus Weil  <janus@gcc.gnu.org>

PR fortran/47730
* gfortran.dg/select_type_22.f03: New.

From-SVN: r170157

gcc/fortran/ChangeLog
gcc/fortran/parse.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/select_type_22.f03 [new file with mode: 0644]

index db0069ea4e694f9f75c8273b216fe97973e7b155..8b4f63f6097a264727de1e06193b8413324a8f20 100644 (file)
@@ -1,3 +1,8 @@
+2011-02-14  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/47730
+       * parse.c (gfc_build_block_ns): Commit 'block@' symbol.
+
 2011-02-14  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/47728
index b51e12bee4676c2beb490e8937f54acad08fcfa8..7fc3dca43be241157abb6dd95804e7b7fd49e415 100644 (file)
@@ -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)
index cd73643e916bf9e6a4350225b2bec70136e1d118..3d21c833960de587b08c4a6eeef7d975c6feeb02 100644 (file)
@@ -1,3 +1,8 @@
+2011-02-14  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/47730
+       * gfortran.dg/select_type_22.f03: New.
+
 2011-02-14  Jason Merrill  <jason@redhat.com>
 
        * 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 (file)
index 0000000..68d2ff6
--- /dev/null
@@ -0,0 +1,17 @@
+! { dg-do compile }
+!
+! PR 47330: [OOP] ICE on invalid source in connection with SELECT TYPE
+!
+! Contributed by Andrew Benson <abenson@its.caltech.edu>
+
+  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