Commit c94a3f9f by Paolo Carlini Committed by Paolo Carlini

re PR c++/71464 (ICE on invalid code (with redeclared constructor) at -Os: Segmentation fault)

/cp
2018-03-03  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/71464
	* optimize.c (maybe_thunk_body): Bail out immediately if either
	fns[0] or fns[1] is null.

/testsuite
2018-03-03  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/71464
	* g++.dg/torture/pr71464.C: New.

From-SVN: r258216
parent 6855fa21
2018-03-03 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71464
* optimize.c (maybe_thunk_body): Bail out immediately if either
fns[0] or fns[1] is null.
2018-03-02 Marek Polacek <polacek@redhat.com> 2018-03-02 Marek Polacek <polacek@redhat.com>
PR c++/84578 PR c++/84578
......
...@@ -261,8 +261,12 @@ maybe_thunk_body (tree fn, bool force) ...@@ -261,8 +261,12 @@ maybe_thunk_body (tree fn, bool force)
populate_clone_array (fn, fns); populate_clone_array (fn, fns);
/* Can happen during error recovery (c++/71464). */
if (!fns[0] || !fns[1])
return 0;
/* Don't use thunks if the base clone omits inherited parameters. */ /* Don't use thunks if the base clone omits inherited parameters. */
if (fns[0] && ctor_omit_inherited_parms (fns[0])) if (ctor_omit_inherited_parms (fns[0]))
return 0; return 0;
DECL_ABSTRACT_P (fn) = false; DECL_ABSTRACT_P (fn) = false;
......
2018-03-03 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71464
* g++.dg/torture/pr71464.C: New.
2018-03-03 Paul Thomas <pault@gcc.gnu.org> 2018-03-03 Paul Thomas <pault@gcc.gnu.org>
PR fortran/80965 PR fortran/80965
......
struct A {};
struct B : virtual A
{
B () {};
B () {}; // { dg-error "cannot be overloaded" }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment