diff options
author | Jason Merrill <jason@redhat.com> | 2020-01-06 20:07:59 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2020-01-06 20:07:59 -0500 |
commit | 665e3b214d89d7938a48f94e8e7fe71b749544b8 (patch) | |
tree | 8c823b462818f7a0beb5ae5c598d4413d48ec2b6 /gcc/cp | |
parent | e4bcf1f5497188d0ca6c4128767dcd0d5953914d (diff) | |
download | gcc-665e3b214d89d7938a48f94e8e7fe71b749544b8.zip gcc-665e3b214d89d7938a48f94e8e7fe71b749544b8.tar.gz gcc-665e3b214d89d7938a48f94e8e7fe71b749544b8.tar.bz2 |
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.
From-SVN: r279936
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/class.c | 1 | ||||
-rw-r--r-- | gcc/cp/pt.c | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 02ebb9f..abcbba5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2020-01-06 Jason Merrill <jason@redhat.com> + + PR c++/92552 - ICE with inherited constrained default ctor. + * pt.c (instantiate_class_template_1): Copy + TYPE_HAS_USER_CONSTRUCTOR. + * class.c (one_inherited_ctor): Don't set it here. + 2020-01-06 Andrew Sutton <asutton@lock3software.com> PR c++/92739 - parsing requires clause with attributes. diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 4da0881..07abe52 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -3141,7 +3141,6 @@ one_inherited_ctor (tree ctor, tree t, tree using_decl) ctor = implicitly_declare_fn (sfk_inheriting_constructor, t, /*const*/false, ctor, parms); add_method (t, ctor, using_decl != NULL_TREE); - TYPE_HAS_USER_CONSTRUCTOR (t) = true; return; } diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index bc23e9e..cd48f53 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11544,6 +11544,7 @@ instantiate_class_template_1 (tree type) SET_TYPE_ALIGN (type, TYPE_ALIGN (pattern)); TYPE_USER_ALIGN (type) = TYPE_USER_ALIGN (pattern); CLASSTYPE_NON_AGGREGATE (type) = CLASSTYPE_NON_AGGREGATE (pattern); + TYPE_HAS_USER_CONSTRUCTOR (type) = TYPE_HAS_USER_CONSTRUCTOR (pattern); if (ANON_AGGR_TYPE_P (pattern)) SET_ANON_AGGR_TYPE_P (type); if (CLASSTYPE_VISIBILITY_SPECIFIED (pattern)) |