aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/semantics.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index d08c1dd..f506a23 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -3663,8 +3663,10 @@ baselink_for_fns (tree fns)
cl = currently_open_derived_class (scope);
if (!cl)
cl = scope;
- cl = TYPE_BINFO (cl);
- return build_baselink (cl, cl, fns, /*optype=*/NULL_TREE);
+ tree access_path = TYPE_BINFO (cl);
+ tree conv_path = (cl == scope ? access_path
+ : lookup_base (cl, scope, ba_any, NULL, tf_none));
+ return build_baselink (conv_path, access_path, fns, /*optype=*/NULL_TREE);
}
/* Returns true iff DECL is a variable from a function outside