From a0f5b987521323a66d307fbccd57e0020509dd97 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 15 Nov 2016 18:05:23 +0100 Subject: decl.c (cp_finish_decomp): For DECL_NAMESPACE_SCOPE_P decl, set DECL_ASSEMBLER_NAME. * decl.c (cp_finish_decomp): For DECL_NAMESPACE_SCOPE_P decl, set DECL_ASSEMBLER_NAME. * parser.c (cp_parser_decomposition_declaration): Likewise if returning error_mark_node. * mangle.c (mangle_decomp): New function. * cp-tree.h (mangle_decomp): New declaration. * g++.dg/cpp1z/decomp13.C: New test. From-SVN: r242434 --- gcc/cp/decl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/cp/decl.c') diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 2af95a7..23ba087 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -7301,7 +7301,6 @@ get_tuple_decomp_init (tree decl, unsigned i) void cp_finish_decomp (tree decl, tree first, unsigned int count) { - location_t loc = DECL_SOURCE_LOCATION (decl); if (error_operand_p (decl)) { error_out: @@ -7315,9 +7314,12 @@ cp_finish_decomp (tree decl, tree first, unsigned int count) } first = DECL_CHAIN (first); } + if (DECL_P (decl) && DECL_NAMESPACE_SCOPE_P (decl)) + SET_DECL_ASSEMBLER_NAME (decl, get_identifier ("")); return; } + location_t loc = DECL_SOURCE_LOCATION (decl); if (type_dependent_expression_p (decl) /* This happens for range for when not in templates. Still add the DECL_VALUE_EXPRs for later processing. */ @@ -7530,6 +7532,8 @@ cp_finish_decomp (tree decl, tree first, unsigned int count) i++; } } + if (DECL_NAMESPACE_SCOPE_P (decl)) + SET_DECL_ASSEMBLER_NAME (decl, mangle_decomp (decl, v)); } /* Returns a declaration for a VAR_DECL as if: -- cgit v1.1