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.
{
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;
}
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))
--- /dev/null
+// 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" } }