+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.
}
/* 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
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.
--- /dev/null
+// 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 } }