From: Jason Merrill Date: Mon, 21 Nov 2016 04:41:21 +0000 (-0500) Subject: PR objc++/78418 - ICE in string tests on darwin X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29c90a3c28a7917023477648f0c88aa273e7510e;p=gcc.git PR objc++/78418 - ICE in string tests on darwin * tree.c (lvalue_kind): Guard DECL_HAS_VALUE_EXPR_P. From-SVN: r242647 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c26f1455a7a..ea07438cd2f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2016-11-18 Jason Merrill + + PR objc++/78418 - ICE in string tests on darwin + * tree.c (lvalue_kind): Guard DECL_HAS_VALUE_EXPR_P. + 2016-11-18 Jakub Jelinek PR c++/77285 diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index d1dd7c40680..9ded9f216d9 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -142,7 +142,7 @@ lvalue_kind (const_tree ref) return clk_none; /* FALLTHRU */ case VAR_DECL: - if (DECL_HAS_VALUE_EXPR_P (ref)) + if (VAR_P (ref) && DECL_HAS_VALUE_EXPR_P (ref)) return lvalue_kind (DECL_VALUE_EXPR (CONST_CAST_TREE (ref))); if (TREE_READONLY (ref) && ! TREE_STATIC (ref)