forked from qt-creator/qt-creator
Fix C++ type hierarchy
Dynamic casts between library boundaries tend to fail. Add an "explicit cast" to CppClass via virtual functions as a quickfix. This is a recurring issue, e.g.d2769f3003,3f11ef9216and2ffd0e2d0dto name just a few... This was introduced in5e861d2be6Task-number: QTCREATORBUG-20001 Change-Id: Ie5a89a028d587e4e9d1ecec920a7c7d17497dbde Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -63,6 +63,11 @@ CppElement::CppElement() : helpCategory(TextEditor::HelpItem::Unknown)
|
||||
CppElement::~CppElement()
|
||||
{}
|
||||
|
||||
CppClass *CppElement::toCppClass()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
class Unknown : public CppElement
|
||||
{
|
||||
public:
|
||||
@@ -156,6 +161,11 @@ bool CppClass::operator==(const CppClass &other)
|
||||
return this->declaration == other.declaration;
|
||||
}
|
||||
|
||||
CppClass *CppClass::toCppClass()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
void CppClass::lookupBases(Symbol *declaration, const LookupContext &context)
|
||||
{
|
||||
typedef QPair<ClassOrNamespace *, CppClass *> Data;
|
||||
|
||||
Reference in New Issue
Block a user