c++: default ctor that's also a list ctor [PR102050]
authorPatrick Palka <ppalka@redhat.com>
Wed, 15 Sep 2021 17:54:53 +0000 (13:54 -0400)
committerPatrick Palka <ppalka@redhat.com>
Wed, 15 Sep 2021 17:54:53 +0000 (13:54 -0400)
commit2ab5c3d5457f0d480c6423ee7ac52ce1f98592c9
treed2875d738cd3ed3fa5dc448e369ebecb23a23103
parent2709337c1181510e3d4f74e86bf75aa83f7b18aa
c++: default ctor that's also a list ctor [PR102050]

In grok_special_member_properties we need to set TYPE_HAS_COPY_CTOR,
TYPE_HAS_DEFAULT_CONSTRUCTOR and TYPE_HAS_LIST_CTOR independently
from each other because a constructor can be both a default and list
constructor (as in the first testcase), or both a default and copy
constructor (as in the second testcase).

PR c++/102050

gcc/cp/ChangeLog:

* decl.c (grok_special_member_properties): Set
TYPE_HAS_COPY_CTOR, TYPE_HAS_DEFAULT_CONSTRUCTOR
and TYPE_HAS_LIST_CTOR independently from each other.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/initlist125.C: New test.
* g++.dg/cpp0x/initlist126.C: New test.
gcc/cp/decl.c
gcc/testsuite/g++.dg/cpp0x/initlist125.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/initlist126.C [new file with mode: 0644]