Quote:I wish I had a concrete example for a reproducable case, but I currently don't.
This is almost always the first step. Your use of the word "psuedocode" worries me.
Mat33 and MyMat33 are very similar names. Any chance you're doing something like this?
const
MyMat33* pMat = (reinterpret_cast<const
Mat33*>( &instance->GetMat() ));
That is, reinterpret_cast<>ing to the wrong type? I ask this because it seems to be refering to the assignment, not the cast itself.
If this was the case, I suggest you actually copy & paste such problematic lines in the future, even if you're not providing all the contextual source. It avoids accidentally fixing the issue without realizing it.
I cannot reproduce your problem on VS2008 -- the following snippet does not exhibit your problem with the exact same line:
struct Mat33 {};struct MyMat33 {};struct HasAMat33 { const Mat33& GetMat();};int main() { HasAMat33* instance; const MyMat33* pMat = (reinterpret_cast<const MyMat33*>( &instance->GetMat() ));}
This snippet compiles, although obviously won't link, nor run without undefined behavior.