diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-11-15 18:05:23 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-11-15 18:05:23 +0100 |
commit | a0f5b987521323a66d307fbccd57e0020509dd97 (patch) | |
tree | 532b81c3e858c986b59c56ab5e42aafddb9e5c99 /gcc/cp/decl.c | |
parent | 84c1b9d3d4d1ead79344b4a9403ec3d74e04d5ef (diff) | |
download | gcc-a0f5b987521323a66d307fbccd57e0020509dd97.zip gcc-a0f5b987521323a66d307fbccd57e0020509dd97.tar.gz gcc-a0f5b987521323a66d307fbccd57e0020509dd97.tar.bz2 |
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
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 6 |
1 files changed, 5 insertions, 1 deletions
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 ("<decomp>")); 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: |