diff --git a/clang/lib/AST/Interp/Pointer.h b/clang/lib/AST/Interp/Pointer.h index 7012009c675af..48aa4df1430fc 100644 --- a/clang/lib/AST/Interp/Pointer.h +++ b/clang/lib/AST/Interp/Pointer.h @@ -212,7 +212,11 @@ class Pointer { } /// Returns the type of the innermost field. - QualType getType() const { return getFieldDesc()->getType(); } + QualType getType() const { + if (inPrimitiveArray() && Offset != Base) + return getFieldDesc()->getType()->getAsArrayTypeUnsafe()->getElementType(); + return getFieldDesc()->getType(); + } Pointer getDeclPtr() const { return Pointer(Pointee); }