* call.c (add_function_candidate): Set LOOKUP_NO_RVAL_BIND for
ref-qualifier handling.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211809
138bc75d-0d04-0410-961f-
82ee72b054a4
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();
+}