PR c++/49458
* call.c (convert_class_to_reference_1): Allow binding function
lvalue to rvalue reference.
From-SVN: r175164
2011-06-17 Jason Merrill <jason@redhat.com>
+ PR c++/49458
+ * call.c (convert_class_to_reference_1): Allow binding function
+ lvalue to rvalue reference.
+
PR c++/43912
Generate proxy VAR_DECLs for better lambda debug info.
* cp-tree.h (FUNCTION_NEEDS_BODY_BLOCK): Add lambda operator().
/* Don't allow binding of lvalues to rvalue references. */
if (TYPE_REF_IS_RVALUE (reference_type)
+ /* Function lvalues are OK, though. */
+ && TREE_CODE (TREE_TYPE (reference_type)) != FUNCTION_TYPE
&& !TYPE_REF_IS_RVALUE (TREE_TYPE (TREE_TYPE (cand->fn))))
cand->second_conv->bad_p = true;
}
2011-06-17 Jason Merrill <jason@redhat.com>
+ * g++.dg/cpp0x/rv-func2.C: New.
+
* g++.dg/debug/dwarf2/lambda1.C: New.
* g++.dg/warn/Wshadow-6.C: Adjust.
--- /dev/null
+// PR c++/49458
+// { dg-options -std=c++0x }
+
+typedef void ftype();
+
+struct A {
+ operator ftype&(void);
+};
+
+ftype &&frvref = A();