This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 08/14] cp/tree.c: strip location wrappers in lvalue_kind
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Nathan Sidwell <nathan at acm dot org>, Jakub Jelinek <jakub at redhat dot com>, Richard Biener <richard dot guenther at gmail dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>, David Malcolm <dmalcolm at redhat dot com>
- Date: Fri, 10 Nov 2017 16:45:23 -0500
- Subject: [PATCH 08/14] cp/tree.c: strip location wrappers in lvalue_kind
- Authentication-results: sourceware.org; auth=none
- References: <CADzB+2kfB26fTGXk2AVWuN1mv641OrcEBze+Lq-KexXHeS=Y9A@mail.gmail.com> <1510350329-48956-1-git-send-email-dmalcolm@redhat.com>
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