Without this, then lvalue_p returns false for decls, and hence
e.g. uses of them for references fail.

Stripping location wrappers in lvalue_kind restores the correct
behavior of lvalue_p etc.

gcc/cp/ChangeLog:
        * tree.c (lvalue_kind): Strip any location wrapper.
---
 gcc/cp/tree.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index b63f2ae..28ff7de 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -56,6 +56,8 @@ lvalue_kind (const_tree ref)
   cp_lvalue_kind op1_lvalue_kind = clk_none;
   cp_lvalue_kind op2_lvalue_kind = clk_none;
 
+  STRIP_ANY_LOCATION_WRAPPER (ref);
+
   /* Expressions of reference type are sometimes wrapped in
      INDIRECT_REFs.  INDIRECT_REFs are just internal compiler
      representation, not part of the language, so we have to look
-- 
1.8.5.3

Reply via email to