This is an archive of the discontinued LLVM Phabricator instance.

[clang][Interp] Fix derived-to-base casts for >1 levels
ClosedPublic

Authored by tbaeder on Feb 7 2023, 2:00 AM.

Details

Summary
The GetPtrBasePop op we were using only works for direct base classes.

Diff Detail

Event Timeline

tbaeder created this revision.Feb 7 2023, 2:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2023, 2:00 AM
tbaeder requested review of this revision.Feb 7 2023, 2:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2023, 2:00 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aaron.ballman added inline comments.Mar 9 2023, 8:36 AM
clang/lib/AST/Interp/ByteCodeExprGen.cpp
1956
clang/test/AST/Interp/records.cpp
278

I think it'd be good to add test coverage for cases like: https://godbolt.org/z/GnPnP4z76

tbaeder updated this revision to Diff 504022.Mar 9 2023, 9:37 PM
tbaeder marked 2 inline comments as done.
tbaeder added inline comments.
clang/test/AST/Interp/records.cpp
278

That even worked :)

This revision is now accepted and ready to land.Mar 10 2023, 5:38 AM
This revision was landed with ongoing or failed builds.Apr 3 2023, 2:36 AM
This revision was automatically updated to reflect the committed changes.