diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-09-18 13:56:03 +0200 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2017-09-25 13:19:28 +0000 |
commit | e79b99edca1a8d38b81c929934ec4093c1292e74 (patch) | |
tree | 9c5c3d341a1aca7361f0b31064b943bd30f2c6e1 /sources/shiboken2/ApiExtractor/clangparser | |
parent | 269eebb9fa81d77977ce5307a849108c5291197d (diff) |
CodeModel: Handle access of inherited classes
Store the access of the base class in the code model.
Remove protected/private base classes in the abstract meta builder
as otherwise invalid code will be generated for classes like
QAbstract3DGraph : public QWindow, protected QOpenGLFunctions
when the protected hack is not in use (on Windows).
Task-number: PYSIDE-487
Change-Id: I5bc2dad16f903da86e6e41450c2f9a76726ac028
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/clangparser')
-rw-r--r-- | sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp index ea6559689..73b1638ef 100644 --- a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp +++ b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp @@ -444,10 +444,11 @@ void BuilderPrivate::addBaseClass(const CXCursor &cursor) QString baseClassName = getTypeName(inheritedType); // use type. const CXCursor declCursor = clang_getTypeDeclaration(inheritedType); const CursorClassHash::const_iterator it = m_cursorClassHash.constFind(declCursor); + const CodeModel::AccessPolicy access = accessPolicy(clang_getCXXAccessSpecifier(cursor)); if (it == m_cursorClassHash.constEnd()) { // Set unqualified name. This happens in cases like "class X : public std::list<...>" // "template<class T> class Foo : public T" and standard types like true_type, false_type. - m_currentClass->setBaseClasses(m_currentClass->baseClasses() << baseClassName); + m_currentClass->addBaseClass(baseClassName, access); return; } // Completely qualify the class name by looking it up and taking its scope @@ -468,7 +469,7 @@ void BuilderPrivate::addBaseClass(const CXCursor &cursor) baseClassName.prepend(colonColon()); baseClassName.prepend(baseScope.join(colonColon())); } - m_currentClass->setBaseClasses(m_currentClass->baseClasses() << baseClassName); + m_currentClass->addBaseClass(baseClassName, access); } static inline CXCursor definitionFromTypeRef(const CXCursor &typeRefCursor) |