search for: hasinfo

Displaying 1 result from an estimated 1 matches for "hasinfo".

2017 Jun 28
2
Multiple Inheritance with dyn_cast
...ted to use dyn_cast with a Multiple Inheritance hierarchy. LLVM’s help page on RTTI claims that it can be done, and that Clang’s Decl and DeclContext implement it; however, when I try to use it I run into odd behavior. Here’s my sample code which doesn’t work: ``` struct Base { void *ptr; bool hasInfo; }; struct Info { int size; static bool classof(const Base *b) { return b->hasInfo; }; }; struct Child : public Base { Child() { this->ptr = this; this->hasInfo = false; } }; struct ChildWithInfo : public Base, public Info { ChildWithInfo() { this->ptr = this;...