summaryrefslogtreecommitdiff
path: root/gcc/cp/expr.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2017-05-26 09:17:54 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2017-05-26 09:17:54 +0000
commit3f43053156e030186b3f33517827740220e2b9f0 (patch)
treed6a31e869ca764436905f87f10676d248ddddf01 /gcc/cp/expr.c
parentd637695ec3d8a9f93479e7f281419d16eaf79fd8 (diff)
downloadgcc-3f43053156e030186b3f33517827740220e2b9f0.tar.gz
* cp-tree.h (struct lang_decl_decomp): New type.
(struct lang_decl): Add u.decomp. (LANG_DECL_DECOMP_CHECK): Define. (DECL_DECOMPOSITION_P): Note it is set also on the vars for user identifiers. (DECL_DECOMP_BASE): Define. (retrofit_lang_decl): Add extra int = 0 argument. * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero use it to influence the selector choices and for selector 0 to non-zero transition copy old content. (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P. * decl.c (poplevel): For DECL_DECOMPOSITION_P, check !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning wording if decl is a structured binding. (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl. Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization of individual variables for tuple structured bindings. (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl. Clear DECL_DECOMP_BASE. * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well. * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what is expected. * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of DECL_VALUE_EXPR. * g++.dg/cpp1z/decomp29.C (p): New variable. (main): Add further tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@248483 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/expr.c')
-rw-r--r--gcc/cp/expr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c
index 75e99e598af..8bd341b814e 100644
--- a/gcc/cp/expr.c
+++ b/gcc/cp/expr.c
@@ -133,8 +133,8 @@ mark_exp_read (tree exp)
switch (TREE_CODE (exp))
{
case VAR_DECL:
- if (DECL_VALUE_EXPR (exp))
- mark_exp_read (DECL_VALUE_EXPR (exp));
+ if (DECL_DECOMPOSITION_P (exp))
+ mark_exp_read (DECL_DECOMP_BASE (exp));
gcc_fallthrough ();
case PARM_DECL:
DECL_READ_P (exp) = 1;