P1008R1 - prohibit aggregates with user-declared constructors
authorJakub Jelinek <jakub@redhat.com>
Tue, 31 Jul 2018 14:19:26 +0000 (16:19 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 31 Jul 2018 14:19:26 +0000 (16:19 +0200)
commit686dca7612a8ab5ebebad2fc13bd9ea7793a7e40
tree219af350267ed3b842757bed1fbe2a10d182b37a
parent8810325ff666643de80110c5c6b4ce1cef921e1b
P1008R1 - prohibit aggregates with user-declared constructors

P1008R1 - prohibit aggregates with user-declared constructors
* class.c (check_bases_and_members): For C++2a set
CLASSTYPE_NON_AGGREGATE based on TYPE_HAS_USER_CONSTRUCTOR rather than
type_has_user_provided_or_explicit_constructor.

* g++.dg/ext/is_aggregate.C: Add tests with deleted or defaulted ctor.
* g++.dg/cpp0x/defaulted1.C (main): Ifdef out for C++2a B b = {1};.
* g++.dg/cpp0x/deleted2.C: Expect error for C++2a.
* g++.dg/cpp2a/aggr1.C: New test.
* g++.dg/cpp2a/aggr2.C: New test.

From-SVN: r263115
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/defaulted1.C
gcc/testsuite/g++.dg/cpp0x/deleted2.C
gcc/testsuite/g++.dg/cpp2a/aggr1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/aggr2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/is_aggregate.C