diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-02-28 10:42:30 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-02-28 15:48:07 +0000 |
commit | 0aa52375886138693caf395238fcd3baf3489dec (patch) | |
tree | fc24d91372e071e41db65831f919b505cb898083 /sources/shiboken2/ApiExtractor/abstractmetalang.h | |
parent | e9c89837f91bf608371a7e39903ecd4038f769c1 (diff) |
shiboken: Fix exception handling when specified in base class
Class-level exception specifications on a base class were not working
so far. This requires a larger refactoring, since the base classes are
not yet known at the point where class functions were traversed
(AbstractMetaBuilder::setupInheritance() is called at a later stage).
To fix this, store the actual type system modification in the
AbstractMetaFunction and move the logic determining whether to
generate exception handling into
AbstractMetaFunction::generateExceptionHandling(). In this function,
recurse down the base classes if the function does not have a
modification set.
This is a preparation for giving the allow-thread attribute, which can
currently only be used at a function level, a similar handling.
Task-number: PYSIDE-62
Change-Id: I28597559511d330cf860c6f6e21ffea229bfab3e
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/abstractmetalang.h')
-rw-r--r-- | sources/shiboken2/ApiExtractor/abstractmetalang.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.h b/sources/shiboken2/ApiExtractor/abstractmetalang.h index 1ab3049b2..56b36b638 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetalang.h +++ b/sources/shiboken2/ApiExtractor/abstractmetalang.h @@ -851,8 +851,7 @@ public: ExceptionSpecification exceptionSpecification() const; void setExceptionSpecification(ExceptionSpecification e); - bool generateExceptionHandling() const { return m_generateExceptionHandling; } - void setGenerateExceptionHandling(bool g) { m_generateExceptionHandling = g; } + bool generateExceptionHandling() const; bool isConversionOperator() const { @@ -1096,6 +1095,10 @@ public: static AbstractMetaFunction * find(const AbstractMetaFunctionList &haystack, const QString &needle); + // for the meta builder only + void setExceptionHandlingModification(TypeSystem::ExceptionHandling em) + { m_exceptionHandlingModification = em; } + #ifndef QT_NO_DEBUG_STREAM void formatDebugVerbose(QDebug &d) const; #endif @@ -1123,9 +1126,9 @@ private: uint m_explicit : 1; uint m_pointerOperator : 1; uint m_isCallOperator : 1; - uint m_generateExceptionHandling: 1; mutable int m_cachedAllowThread = -1; ExceptionSpecification m_exceptionSpecification = ExceptionSpecification::Unknown; + TypeSystem::ExceptionHandling m_exceptionHandlingModification = TypeSystem::ExceptionHandling::Unspecified; }; Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractMetaFunction::CompareResult) |