PR c++/80972 - C++17 ICE with attribute packed.

* call.c (build_over_call): Allow a TARGET_EXPR from reference
	binding.

From-SVN: r249420
This commit is contained in:
Jason Merrill 2017-06-20 12:47:17 -04:00 committed by Jason Merrill
parent 1e5d210275
commit d276da0cf5
3 changed files with 14 additions and 0 deletions

View File

@ -1,3 +1,9 @@
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.

View File

@ -8025,6 +8025,8 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
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));

View File

@ -0,0 +1,6 @@
// PR c++/80972
struct A { int i; };
struct B { A a; } __attribute__((packed));
A a = B().a;