Commit e260b0a7 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/79899 (ICE in ctor_omit_inherited_parms at gcc/cp/method.c:576 on ARM target)

	PR c++/79899
	* optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
	Use XALLOCAVEC macro.

	* g++.dg/other/friend7.C: New test.

From-SVN: r246038
parent da0ced6e
2017-03-10 Jakub Jelinek <jakub@redhat.com>
PR c++/79899
* optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
Use XALLOCAVEC macro.
PR c++/79896
* decl.c (finish_enum_value_list): If value is error_mark_node,
don't copy it and change its type.
......
......@@ -262,7 +262,7 @@ maybe_thunk_body (tree fn, bool force)
populate_clone_array (fn, fns);
/* Don't use thunks if the base clone omits inherited parameters. */
if (ctor_omit_inherited_parms (fns[0]))
if (fns[0] && ctor_omit_inherited_parms (fns[0]))
return 0;
DECL_ABSTRACT_P (fn) = false;
......@@ -324,7 +324,7 @@ maybe_thunk_body (tree fn, bool force)
if (length > max_parms)
max_parms = length;
}
args = (tree *) alloca (max_parms * sizeof (tree));
args = XALLOCAVEC (tree, max_parms);
/* We know that any clones immediately follow FN in TYPE_METHODS. */
FOR_EACH_CLONE (clone, fn)
......
2017-03-10 Jakub Jelinek <jakub@redhat.com>
PR c++/79899
* g++.dg/other/friend7.C: New test.
PR c++/79896
* g++.dg/ext/int128-5.C: New test.
......
// PR c++/79899
// { dg-do compile }
// { dg-options "-Os" }
struct A
{
friend A::~A() {} // { dg-error "implicitly friends of their class" }
};
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