re PR c++/61392 (internal compiler error: in write_template_arg_literal, at cp/mangle.c:3072)

PR c++/61392
	* mangle.c (write_expression): Use unresolved-name mangling for
	DR850 case.

From-SVN: r215414
This commit is contained in:
Jason Merrill 2014-09-19 20:55:14 -04:00 committed by Jason Merrill
parent 207fd2123a
commit e2254932f9
4 changed files with 24 additions and 4 deletions

View file

@ -1,5 +1,9 @@
2014-09-19 Jason Merrill <jason@redhat.com>
PR c++/61392
* mangle.c (write_expression): Use unresolved-name mangling for
DR850 case.
PR c++/61465
* call.c (convert_like_real) [ck_identity]: Call mark_rvalue_use
after pulling out an element from a CONSTRUCTOR.

View file

@ -2861,11 +2861,16 @@ write_expression (tree expr)
{
write_string (operator_name_info[(int)code].mangled_name);
ob = TREE_OPERAND (ob, 0);
write_expression (ob);
}
else
write_string ("dt");
else if (!is_dummy_object (ob))
{
write_string ("dt");
write_expression (ob);
}
/* else, for a non-static data member with no associated object (in
unevaluated context), use the unresolved-name mangling. */
write_expression (ob);
write_member_name (TREE_OPERAND (expr, 1));
return;
}

View file

@ -1685,7 +1685,7 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope)
if (object == error_mark_node)
return error_mark_node;
/* DR 613: Can use non-static data members without an associated
/* DR 613/850: Can use non-static data members without an associated
object in sizeof/decltype/alignof. */
if (is_dummy_object (object) && cp_unevaluated_operand == 0
&& (!processing_template_decl || !current_class_ref))

View file

@ -0,0 +1,11 @@
// DR 850 makes this valid
// { dg-do compile { target c++11 } }
template<class T> struct A
{
int mem;
template<class U> decltype(U()+mem) f();
};
int i = A<int>().f<int>();
// { dg-final { scan-assembler "_ZN1AIiE1fIiEEDTplcvT__E3memEv" } }