* except.c (check_noexcept_r): Assert that fn is POINTER_TYPE_P.
authorJason Merrill <jason@redhat.com>
Mon, 17 Aug 2015 18:40:57 +0000 (14:40 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 17 Aug 2015 18:40:57 +0000 (14:40 -0400)
From-SVN: r226947

gcc/cp/ChangeLog
gcc/cp/except.c

index a5a42ff11a570fb7bbfc28696fa8cc9665fd7c13..595781cdb3ecf5bbb40e760c7793d88ee757ebfa 100644 (file)
@@ -1,3 +1,7 @@
+2015-08-17  Jason Merrill  <jason@redhat.com>
+
+       * except.c (check_noexcept_r): Assert that fn is POINTER_TYPE_P.
+
 2015-08-14  Jason Merrill  <jason@redhat.com>
 
        PR c++/65974
index 6c366464fbafece07db8aa3f814eb95aa0786f2b..4f06f52d1daf73e743d6b12ccb4e0f210bd87ba3 100644 (file)
@@ -1155,7 +1155,9 @@ check_noexcept_r (tree *tp, int * /*walk_subtrees*/, void * /*data*/)
          We could use TREE_NOTHROW (t) for !TREE_PUBLIC fns, though... */
       tree fn = (code == AGGR_INIT_EXPR
                 ? AGGR_INIT_EXPR_FN (t) : CALL_EXPR_FN (t));
-      tree type = TREE_TYPE (TREE_TYPE (fn));
+      tree type = TREE_TYPE (fn);
+      gcc_assert (POINTER_TYPE_P (type));
+      type = TREE_TYPE (type);
 
       STRIP_NOPS (fn);
       if (TREE_CODE (fn) == ADDR_EXPR)