PR objc++/78418 - ICE in string tests on darwin
authorJason Merrill <jason@redhat.com>
Mon, 21 Nov 2016 04:41:21 +0000 (23:41 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 21 Nov 2016 04:41:21 +0000 (23:41 -0500)
* tree.c (lvalue_kind): Guard DECL_HAS_VALUE_EXPR_P.

From-SVN: r242647

gcc/cp/ChangeLog
gcc/cp/tree.c

index c26f1455a7aacd21491f1d60d34067c7eddcbe2d..ea07438cd2fdc27c1ef9e97cccb6379e8c7cc20d 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-18  Jason Merrill  <jason@redhat.com>
+
+       PR objc++/78418 - ICE in string tests on darwin
+       * tree.c (lvalue_kind): Guard DECL_HAS_VALUE_EXPR_P.
+
 2016-11-18  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/77285
index d1dd7c40680f27eff76e4a105acdcc71b0c5d19f..9ded9f216d90470429d99ff2eeb18bc2b4262f59 100644 (file)
@@ -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)