diff options
Diffstat (limited to 'gcc/cp/tree.c')
| -rw-r--r-- | gcc/cp/tree.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index fec5afa..297da2b 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -3242,15 +3242,11 @@ bot_replace (tree* t, int* /*walk_subtrees*/, void* data_) else if (TREE_CODE (*t) == CONVERT_EXPR && CONVERT_EXPR_VBASE_PATH (*t)) { - /* In an NSDMI build_base_path defers building conversions to virtual - bases, and we handle it here. */ - tree basetype = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (*t))); - vec<tree, va_gc> *vbases = CLASSTYPE_VBASECLASSES (current_class_type); - int i; tree binfo; - FOR_EACH_VEC_SAFE_ELT (vbases, i, binfo) - if (BINFO_TYPE (binfo) == basetype) - break; - *t = build_base_path (PLUS_EXPR, TREE_OPERAND (*t, 0), binfo, true, + /* In an NSDMI build_base_path defers building conversions to morally + virtual bases, and we handle it here. */ + tree basetype = TREE_TYPE (*t); + *t = convert_to_base (TREE_OPERAND (*t, 0), basetype, + /*check_access=*/false, /*nonnull=*/true, tf_warning_or_error); } |
