diff options
author | Jason Merrill <jason@redhat.com> | 2013-02-22 17:24:10 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2013-02-22 17:24:10 -0500 |
commit | 3ced2284b437b9e5a46c165df006a5a52cb5d18c (patch) | |
tree | 43394e2f9aaa9321cb9f210dc364757d54a663ac /gcc/cp/call.c | |
parent | 5b5d851ea0015765d83b329d93484dcd8ccc8c1e (diff) | |
download | gcc-3ced2284b437b9e5a46c165df006a5a52cb5d18c.tar.gz |
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
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 25dfd51c4f9..7c414217f05 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -8765,11 +8765,18 @@ can_convert_arg (tree to, tree from, tree arg, int flags, /* Get the high-water mark for the CONVERSION_OBSTACK. */ 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, flags, complain); ok_p = (t && !t->bad_p); + /* Discard the access checks now. */ + pop_deferring_access_checks (); /* Free all the conversions we allocated. */ obstack_free (&conversion_obstack, p); |