PR c++/59296
* call.c (add_function_candidate): Set LOOKUP_NO_RVAL_BIND for
ref-qualifier handling.
From-SVN: r211809
2014-06-18 Jason Merrill <jason@redhat.com>
+ PR c++/59296
+ * call.c (add_function_candidate): Set LOOKUP_NO_RVAL_BIND for
+ ref-qualifier handling.
+
PR c++/61507
* pt.c (resolve_overloaded_unification): Preserve
ARGUMENT_PACK_EXPLICIT_ARGS.
object parameter has reference type. */
bool rv = FUNCTION_RVALUE_QUALIFIED (TREE_TYPE (fn));
parmtype = cp_build_reference_type (parmtype, rv);
+ /* Don't bind an rvalue to a const lvalue ref-qualifier. */
+ lflags |= LOOKUP_NO_RVAL_BIND;
}
else
{
--- /dev/null
+// PR c++/59296
+// { dg-do compile { target c++11 } }
+
+struct Type
+{
+ void get() const& { }
+ void get() const&& { }
+};
+
+int main()
+{
+ Type{}.get();
+}