https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92552

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Tue Jan  7 01:07:59 2020
New Revision: 279936

URL: https://gcc.gnu.org/viewcvs?rev=279936&root=gcc&view=rev
Log:
        PR c++/92552 - ICE with inherited constrained default ctor.

We set TYPE_HAS_USER_CONSTRUCTOR on the template type in lookup_using_decl,
but we didn't copy it to the instantiation.  Setting it in
one_inherited_ctor is too late, as that gets called after we decide whether
to set CLASSTYPE_LAZY_DEFAULT_CTOR.  This change affects other testcases as
well; the changes are fixes for the other inherited constructor tests as
well.

        * pt.c (instantiate_class_template_1): Copy
        TYPE_HAS_USER_CONSTRUCTOR.
        * class.c (one_inherited_ctor): Don't set it here.

Added:
    trunk/gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor7.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/g++.dg/concepts/inherit-ctor3.C
    trunk/gcc/testsuite/g++.dg/cpp2a/concepts-inherit-ctor2.C
    trunk/gcc/testsuite/g++.dg/template/crash7.C
    trunk/gcc/testsuite/g++.old-deja/g++.pt/error2.C

Reply via email to