From 29c90a3c28a7917023477648f0c88aa273e7510e Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sun, 20 Nov 2016 23:41:21 -0500 Subject: [PATCH] PR objc++/78418 - ICE in string tests on darwin * tree.c (lvalue_kind): Guard DECL_HAS_VALUE_EXPR_P. From-SVN: r242647 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/tree.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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) -- 2.30.2