* call.c (build_over_call): Allow a TARGET_EXPR from reference
binding.
From-SVN: r249420
+2017-06-20 Jason Merrill <jason@redhat.com>
+
+ PR c++/80972 - C++17 ICE with attribute packed.
+ * call.c (build_over_call): Allow a TARGET_EXPR from reference
+ binding.
+
2017-06-20 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
subobject. */
if (CHECKING_P && cxx_dialect >= cxx1z)
gcc_assert (TREE_CODE (arg) != TARGET_EXPR
+ /* It's from binding the ref parm to a packed field. */
+ || convs[0]->need_temporary_p
|| seen_error ()
/* See unsafe_copy_elision_p. */
|| DECL_BASE_CONSTRUCTOR_P (fn));
--- /dev/null
+// PR c++/80972
+
+struct A { int i; };
+struct B { A a; } __attribute__((packed));
+
+A a = B().a;