From c484627cf619d93610d2c9dca6950c9e70a65cf3 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Wed, 18 Jan 2017 19:27:52 +0000 Subject: [PATCH] re PR c++/78488 (P0136R1 ICE when building call to inherited default constructor.) PR c++/78488 * call.c (build_over_call): When checking ellipsis conversions for an inherited ctor, make sure there is at least one conversion. * g++.dg/cpp1z/inh-ctor37.C: New. From-SVN: r244592 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/call.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp1z/inh-ctor37.C | 13 +++++++++++++ 4 files changed, 25 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1z/inh-ctor37.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8684755..11dfbad 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2017-01-18 Nathan Sidwell + + PR c++/78488 + * call.c (build_over_call): When checking ellipsis conversions for + an inherited ctor, make sure there is at least one conversion. + 2017-01-18 Jason Merrill PR c++/78894 - ICE with class deduction and default arg diff --git a/gcc/cp/call.c b/gcc/cp/call.c index e431221..88d83dd 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -7899,6 +7899,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) could handle this by open-coding the inherited constructor rather than defining it, but let's not bother now. */ if (!cp_unevaluated_operand + && cand->num_convs && cand->convs[cand->num_convs-1]->ellipsis_p) { if (complain & tf_error) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 538e08e..e142e3e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-01-18 Nathan Sidwell + + PR c++/78488 + * g++.dg/cpp1z/inh-ctor37.C: New. + 2017-01-18 Uros Bizjak PR rtl-optimization/78952 diff --git a/gcc/testsuite/g++.dg/cpp1z/inh-ctor37.C b/gcc/testsuite/g++.dg/cpp1z/inh-ctor37.C new file mode 100644 index 0000000..d501c5b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/inh-ctor37.C @@ -0,0 +1,13 @@ +// { dg-do compile { target c++11 } } +// PR 78488, seg fault with inherited ctor + +struct Foo { Foo() {} }; + +struct Bar : Foo { + using Foo::Foo; + Bar(void*); +}; + +int main() { + Bar f; +} -- 2.7.4