Commit a1afa75e by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/85208 (ICE with #pragma weak and structured binding)

	PR c++/85208
	* decl.c (start_decl): For DECL_DECOMPOSITION_P decls, don't call
	maybe_apply_pragma_weak here...
	(cp_maybe_mangle_decomp): ... but call it here instead.

	* g++.dg/cpp1z/decomp41.C: New test.

From-SVN: r259155
parent d600a0ce
2018-04-05 Jakub Jelinek <jakub@redhat.com>
PR c++/85208
* decl.c (start_decl): For DECL_DECOMPOSITION_P decls, don't call
maybe_apply_pragma_weak here...
(cp_maybe_mangle_decomp): ... but call it here instead.
2018-04-05 Jason Merrill <jason@redhat.com>
PR c++/85136 - ICE with designated init in template.
......
......@@ -5090,7 +5090,7 @@ start_decl (const cp_declarator *declarator,
}
/* If #pragma weak was used, mark the decl weak now. */
if (!processing_template_decl)
if (!processing_template_decl && !DECL_DECOMPOSITION_P (decl))
maybe_apply_pragma_weak (decl);
if (TREE_CODE (decl) == FUNCTION_DECL
......@@ -7510,6 +7510,7 @@ cp_maybe_mangle_decomp (tree decl, tree first, unsigned int count)
for (unsigned int i = 0; i < count; i++, d = DECL_CHAIN (d))
v[count - i - 1] = d;
SET_DECL_ASSEMBLER_NAME (decl, mangle_decomp (decl, v));
maybe_apply_pragma_weak (decl);
}
}
......
2018-04-05 Jakub Jelinek <jakub@redhat.com>
PR c++/85208
* g++.dg/cpp1z/decomp41.C: New test.
PR middle-end/85195
* gcc.dg/pr85195.c: New test.
......
// PR c++/85208
// { dg-do compile { target c++11 } }
// { dg-require-weak "" }
// { dg-options "" }
#pragma weak _ZDC1d1e1fE
struct A { int i, j, k; };
auto [a, b, c] = A (); // { dg-warning "structured bindings only available with" "" { target c++14_down } }
auto [d, e, f] = A (); // { dg-warning "structured bindings only available with" "" { target c++14_down } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment