Commit 01290963 by Jason Merrill Committed by Jason Merrill

re PR c++/55249 (Multiple copy constructors for template class lead to link errors)

	PR c++/55249
	* tree.c (build_vec_init_elt): Use the type of the initializer.

From-SVN: r194281
parent 2c340383
2012-12-06 Jason Merrill <jason@redhat.com>
PR c++/55249
* tree.c (build_vec_init_elt): Use the type of the initializer.
PR c++/54744
* pt.c (resolve_typename_type): Check TYPENAME_IS_RESOLVING_P on scope.
* init.c (expand_member_init): Check for being in a template first.
......
......@@ -524,7 +524,8 @@ build_vec_init_elt (tree type, tree init, tsubst_flags_t complain)
argvec = make_tree_vector ();
if (init)
{
tree dummy = build_dummy_object (inner_type);
tree init_type = strip_array_types (TREE_TYPE (init));
tree dummy = build_dummy_object (init_type);
if (!real_lvalue_p (init))
dummy = move (dummy);
argvec->quick_push (dummy);
......
// PR c++/55249
template <typename _Tp> struct A
{
_Tp _M_instance[1];
};
template <class> struct inner_type
{
inner_type () {}
inner_type (inner_type &);
inner_type (const inner_type &) {}
};
int
main ()
{
A <inner_type <int> > a, b = a;
}
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