Skip to content

Commit 8ad37a8

Browse files
committed
[clang][Interp][NFC] Return array element type in Pointer::getType()
This is irrelevant for the current tests, but makes sense and later changes easier.
1 parent 658a4fd commit 8ad37a8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

clang/lib/AST/Interp/Pointer.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,11 @@ class Pointer {
212212
}
213213

214214
/// Returns the type of the innermost field.
215-
QualType getType() const { return getFieldDesc()->getType(); }
215+
QualType getType() const {
216+
if (inPrimitiveArray() && Offset != Base)
217+
return getFieldDesc()->getType()->getAsArrayTypeUnsafe()->getElementType();
218+
return getFieldDesc()->getType();
219+
}
216220

217221
Pointer getDeclPtr() const { return Pointer(Pointee); }
218222

0 commit comments

Comments
 (0)