Commit e2c17be0 by Jason Merrill Committed by Jason Merrill

re PR c++/49569 (-std=gnu++0x causes segmentation fault)

	PR c++/49569
	* method.c (implicitly_declare_fn): Set DECL_PARM_LEVEL and
	DECL_PARM_INDEX on rhs parm.

From-SVN: r175738
parent 98ff3996
2011-06-30 Jason Merrill <jason@redhat.com>
PR c++/49569
* method.c (implicitly_declare_fn): Set DECL_PARM_LEVEL and
DECL_PARM_INDEX on rhs parm.
* pt.c (iterative_hash_template_arg): Use cp_tree_operand_length.
PR c++/49355
......
......@@ -1528,8 +1528,11 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p)
/* Note that this parameter is *not* marked DECL_ARTIFICIAL; we
want its type to be included in the mangled function
name. */
DECL_ARGUMENTS (fn) = cp_build_parm_decl (NULL_TREE, rhs_parm_type);
TREE_READONLY (DECL_ARGUMENTS (fn)) = 1;
tree decl = cp_build_parm_decl (NULL_TREE, rhs_parm_type);
TREE_READONLY (decl) = 1;
retrofit_lang_decl (decl);
DECL_PARM_INDEX (decl) = DECL_PARM_LEVEL (decl) = 1;
DECL_ARGUMENTS (fn) = decl;
}
/* Add the "this" parameter. */
this_parm = build_this_parm (fn_type, TYPE_UNQUALIFIED);
......
2011-06-30 Jason Merrill <jason@redhat.com>
PR c++/49569
* g++.dg/cpp0x/regress/ctor1.C: New.
PR c++/49355
* g++.dg/cpp0x/initlist54.C: New.
......
// PR c++/49569
// { dg-options -std=c++0x }
struct A
{
virtual void f() = 0;
};
struct B: A
{
int i;
virtual void f() { }
};
struct C
{
B b;
C(): b() { }
C(const B& b): b(b) { }
};
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