aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 85310e0..73eeb01 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -5027,6 +5027,9 @@ mark_used (tree decl, tsubst_flags_t complain)
/* Set TREE_USED for the benefit of -Wunused. */
TREE_USED (decl) = 1;
+ /* And for structured bindings also the underlying decl. */
+ if (DECL_DECOMPOSITION_P (decl) && DECL_DECOMP_BASE (decl))
+ TREE_USED (DECL_DECOMP_BASE (decl)) = 1;
if (TREE_CODE (decl) == TEMPLATE_DECL)
return true;