[PATCH] D143480: [clang][Interp] Fix derived-to-base casts for >1 levels

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 9 08:36:16 PST 2023


aaron.ballman added inline comments.


================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1949
+  // Pointer of derived type is already on the stack.
+  const CXXRecordDecl *FinalDecl = cast<CXXRecordDecl>(BaseType->getDecl());
+  const RecordDecl *CurDecl = DerivedType->getDecl();
----------------



================
Comment at: clang/test/AST/Interp/records.cpp:266
 };
 #endif
 
----------------
I think it'd be good to add test coverage for cases like: https://godbolt.org/z/GnPnP4z76


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143480/new/

https://reviews.llvm.org/D143480



More information about the cfe-commits mailing list