Commit 74f4bbb7 by Jason Merrill Committed by Jason Merrill

re PR c++/59296 ([c++11] ref-qualified member function is ambiguous)

	PR c++/59296
	* call.c (add_function_candidate): Set LOOKUP_NO_RVAL_BIND for
	ref-qualifier handling.

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