PR c++/92590 - wrong handling of inherited default ctor.
authorJason Merrill <jason@redhat.com>
Tue, 14 Jan 2020 18:59:54 +0000 (13:59 -0500)
committerJason Merrill <jason@redhat.com>
Tue, 14 Jan 2020 20:20:12 +0000 (15:20 -0500)
commit08c8c973c082457a7d6192673e87475f1fdfdbef
treeb04556341be3025f2077cdc3fe0e0c9fa9122bcf
parenta5a3c2dcf73aa245b0eb6f6cf56c4d03ab6056da
PR c++/92590 - wrong handling of inherited default ctor.

I thought my earlier fix for 91930 was an obvious bug fix, but apparently an
inherited constructor does not count as user-declared.  So this patch
reverts that change and the other follow-on patches, and fixes 91930
differently, by not letting the inherited default constructor hide the
implicitly-declared default constructor.

* class.c (add_method): A constrained inherited ctor doesn't hide an
implicit derived ctor.

Revert:
PR c++/91930 - ICE with constrained inherited default ctor.
* name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
for inherited constructor.
PR c++/92552 - ICE with inherited constrained default ctor.
* pt.c (instantiate_class_template_1): Copy
TYPE_HAS_USER_CONSTRUCTOR.
PR c++/92594 - ICE with inherited trivial default ctor.
* method.c (trivial_fn_p): Treat an inherited default constructor
like a normal default constructor.
12 files changed:
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/method.c
gcc/cp/name-lookup.c
gcc/cp/pt.c
gcc/testsuite/g++.dg/concepts/inherit-ctor3.C
gcc/testsuite/g++.dg/cpp0x/inh-ctor35.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/inh-ctor5.C
gcc/testsuite/g++.dg/cpp1z/inh-ctor22.C
gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor2.C
gcc/testsuite/g++.dg/template/crash7.C
gcc/testsuite/g++.old-deja/g++.pt/error2.C