Commit e2254932 by Jason Merrill Committed by Jason Merrill

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
parent 207fd212
2014-09-19 Jason Merrill <jason@redhat.com> 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 PR c++/61465
* call.c (convert_like_real) [ck_identity]: Call mark_rvalue_use * call.c (convert_like_real) [ck_identity]: Call mark_rvalue_use
after pulling out an element from a CONSTRUCTOR. after pulling out an element from a CONSTRUCTOR.
......
...@@ -2861,11 +2861,16 @@ write_expression (tree expr) ...@@ -2861,11 +2861,16 @@ write_expression (tree expr)
{ {
write_string (operator_name_info[(int)code].mangled_name); write_string (operator_name_info[(int)code].mangled_name);
ob = TREE_OPERAND (ob, 0); ob = TREE_OPERAND (ob, 0);
write_expression (ob);
} }
else else if (!is_dummy_object (ob))
write_string ("dt"); {
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)); write_member_name (TREE_OPERAND (expr, 1));
return; return;
} }
......
...@@ -1685,7 +1685,7 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope) ...@@ -1685,7 +1685,7 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope)
if (object == error_mark_node) if (object == error_mark_node)
return 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. */ object in sizeof/decltype/alignof. */
if (is_dummy_object (object) && cp_unevaluated_operand == 0 if (is_dummy_object (object) && cp_unevaluated_operand == 0
&& (!processing_template_decl || !current_class_ref)) && (!processing_template_decl || !current_class_ref))
......
// 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" } }
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