================
@@ -3569,6 +3583,190 @@ TEST(TransferTest, StaticCast) {
       });
 }
 
+TEST(TransferTest, StaticCastBaseToDerived) {
+  std::string Code = R"cc(
+    struct Base {};
+    struct Derived : public Base {};
+    void target(Base* B) {
+      Derived* D = static_cast<Derived*>(B);
----------------
bazuzi wrote:

An out-of-tree test failure displayed exactly such an issue with accessing 
fields of `Derived` after the cast. Added special handling for that case.

No such handling seemed to be necessary for reinterpret cast, but I've added a 
test to demonstrate the existing behavior that already models the fields.

https://github.com/llvm/llvm-project/pull/153066
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to