c++: Implement CWG2635 - Constrained structured bindings
authorJakub Jelinek <jakub@redhat.com>
Fri, 18 Nov 2022 08:04:16 +0000 (09:04 +0100)
committerJakub Jelinek <jakub@redhat.com>
Fri, 18 Nov 2022 08:04:16 +0000 (09:04 +0100)
commite5049dfbe294abc56953d4f0b412000cd8a1f39e
treeaaa71c71958e5835ed51da675ffb35b64c2ef448
parentc5df8392c5848c0462558f41cdf6eab31db301cf
c++: Implement CWG2635 - Constrained structured bindings

The following patch implements CWG2635.

2022-11-18  Jakub Jelinek  <jakub@redhat.com>

* decl.cc (grokdeclarator): Implement
CWG2635 - Constrained structured bindings.  Emit a pedwarn on
constrained auto type.  Add auto_diagnostic_group for error_at
and inform for non-auto type on structured bindings declaration.

* g++.dg/cpp2a/decomp5.C: New test.
* g++.dg/cpp2a/decomp6.C: New test.
* g++.dg/cpp2a/decomp7.C: New test.
* g++.dg/cpp2a/concepts-placeholder7.C: Adjust expected diagnostics.
* g++.dg/cpp2a/concepts-placeholder8.C: Likewise.
* g++.dg/cpp2a/concepts-placeholder9.C: New test.
* g++.dg/cpp2a/concepts-placeholder10.C: New test.
gcc/cp/decl.cc
gcc/testsuite/g++.dg/cpp2a/concepts-placeholder10.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/concepts-placeholder7.C
gcc/testsuite/g++.dg/cpp2a/concepts-placeholder8.C
gcc/testsuite/g++.dg/cpp2a/concepts-placeholder9.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/decomp5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/decomp6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/decomp7.C [new file with mode: 0644]