diff options
Diffstat (limited to 'gcc/cp/constexpr.cc')
-rw-r--r-- | gcc/cp/constexpr.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc index e1b2d27..051f73f 100644 --- a/gcc/cp/constexpr.cc +++ b/gcc/cp/constexpr.cc @@ -5709,7 +5709,8 @@ cxx_fold_indirect_ref_1 (const constexpr_ctx *ctx, location_t loc, tree type, } /* Handle conversion to "as base" type. */ - if (CLASSTYPE_AS_BASE (optype) == type) + if (CLASS_TYPE_P (optype) + && CLASSTYPE_AS_BASE (optype) == type) return op; /* Handle conversion to an empty base class, which is represented with a |