This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Minor C++ PATCH to check_noexcept_r
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 17 Aug 2015 14:40:27 -0400
- Subject: Minor C++ PATCH to check_noexcept_r
- Authentication-results: sourceware.org; auth=none
For a while, on the concepts branch check_noexcept_r was seeing a
CALL_EXPR where the fn operand was not a pointer or reference to
function, which caused trouble. Let's add an assert for that.
Tested x86_64-pc-linux-gnu, applying to trunk.
commit 4fbc043d90cbc3820e1eeb381d709c2631b7daeb
Author: Jason Merrill <jason@redhat.com>
Date: Wed Aug 5 21:37:23 2015 -0400
* except.c (check_noexcept_r): Assert that fn is POINTER_TYPE_P.
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 6c36646..4f06f52 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)