re PR c++/81888 (Structured bindings stopped working)
authorJakub Jelinek <jakub@redhat.com>
Mon, 27 Nov 2017 21:54:25 +0000 (22:54 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 27 Nov 2017 21:54:25 +0000 (22:54 +0100)
commitde3d4fd0f5439fcc8e3ae10d9f439c007dfacb1d
treeb139900e645ba6d6ef76b0bf7e6d6a274c45d0da
parent528c7559a84012642c6a6f80380578572aceaf5c
re PR c++/81888 (Structured bindings stopped working)

PR c++/81888
* parser.c (cp_parser_decomposition_declaration): Reject just
BRACE_ENCLOSED_INITIALIZER_P initializers with nelts != 1 rather
than all such CONSTRUCTORs, and only if is_direct_init is true.

* g++.dg/cpp1z/decomp30.C: Add a test for structured binding with
= {} and = { a, a } initializers.
* g++.dg/cpp1z/decomp31.C: New test.

From-SVN: r255180
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/decomp30.C
gcc/testsuite/g++.dg/cpp1z/decomp31.C [new file with mode: 0644]