Commit 3ced2284 by Jason Merrill Committed by Jason Merrill

re PR c++/56359 (Bogus "error: no matching function for call to ...")

	PR c++/56359
	* call.c (can_convert_arg): Discard access checks.

From-SVN: r196229
parent 5b5d851e
2013-02-22 Jason Merrill <jason@redhat.com> 2013-02-22 Jason Merrill <jason@redhat.com>
PR c++/56359
* call.c (can_convert_arg): Discard access checks.
PR c++/56395 PR c++/56395
* tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
args. args.
......
...@@ -8765,11 +8765,18 @@ can_convert_arg (tree to, tree from, tree arg, int flags, ...@@ -8765,11 +8765,18 @@ can_convert_arg (tree to, tree from, tree arg, int flags,
/* Get the high-water mark for the CONVERSION_OBSTACK. */ /* Get the high-water mark for the CONVERSION_OBSTACK. */
p = conversion_obstack_alloc (0); p = conversion_obstack_alloc (0);
/* We want to discard any access checks done for this test,
as we might not be in the appropriate access context and
we'll do the check again when we actually perform the
conversion. */
push_deferring_access_checks (dk_deferred);
t = implicit_conversion (to, from, arg, /*c_cast_p=*/false, t = implicit_conversion (to, from, arg, /*c_cast_p=*/false,
flags, complain); flags, complain);
ok_p = (t && !t->bad_p); ok_p = (t && !t->bad_p);
/* Discard the access checks now. */
pop_deferring_access_checks ();
/* Free all the conversions we allocated. */ /* Free all the conversions we allocated. */
obstack_free (&conversion_obstack, p); obstack_free (&conversion_obstack, p);
......
// PR c++/56359
typedef int (*InvocationCallback) (const int &);
template < typename target_t >
void SetPrototypeMethod (target_t, const char *, InvocationCallback);
class A
{
void Initialize ();
protected:
static int Stop (const int &);
void Stop (); // comment out to make the bug disappear.
};
void
A::Initialize ()
{
SetPrototypeMethod (0, "stop", A::Stop);
}
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