diff options
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r-- | gcc/cp/class.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 0ce4ba4..9f7d986 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -296,7 +296,12 @@ build_base_path (enum tree_code code, /* Don't bother with the calculations inside sizeof; they'll ICE if the source type is incomplete and the pointer value doesn't matter. */ if (skip_evaluation) - return build_nop (build_pointer_type (target_type), expr); + { + expr = build_nop (build_pointer_type (target_type), expr); + if (!want_pointer) + expr = build_indirect_ref (expr, NULL); + return expr; + } /* Do we need to check for a null pointer? */ if (want_pointer && !nonnull) |