From 5c563482ac83d8d2874f2cd4f608eae57d966dee Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 17 Aug 2015 14:40:57 -0400 Subject: [PATCH] * except.c (check_noexcept_r): Assert that fn is POINTER_TYPE_P. From-SVN: r226947 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/except.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a5a42ff11a5..595781cdb3e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2015-08-17 Jason Merrill + + * except.c (check_noexcept_r): Assert that fn is POINTER_TYPE_P. + 2015-08-14 Jason Merrill PR c++/65974 diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 6c366464fba..4f06f52d1da 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -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) -- 2.30.2