diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-14 10:51:17 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-17 12:22:27 +0000 |
commit | 853b637b02b07d502ddb5e84bcf60f6a8a58cf29 (patch) | |
tree | 1572e29be67998ef5be7bd77cf11f4b6ef723730 /sources/shiboken2/ApiExtractor/parser/codemodel.cpp | |
parent | 792be5e470107d6d2752fd78e3922427c313b67a (diff) |
shiboken: Extend exception specification
Change boolean 'noexcept' flag into an enumeration
that indicates whether a function throws, is 'noexcept'
or the behavior is unknown.
This makes it easier to implement an 'auto' mode
for exception handling.
Task-number: PYSIDE-62
Change-Id: I4e5405863e5af2a54f3528ba5eb5c51d3929703d
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/parser/codemodel.cpp')
-rw-r--r-- | sources/shiboken2/ApiExtractor/parser/codemodel.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp index c9861b510..173f6dd23 100644 --- a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp +++ b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp @@ -1013,12 +1013,17 @@ void _FunctionModelItem::setVariadics(bool isVariadics) bool _FunctionModelItem::isNoExcept() const { - return m_isNoExcept; + return m_exceptionSpecification == ExceptionSpecification::NoExcept; } -void _FunctionModelItem::setNoExcept(bool n) +ExceptionSpecification _FunctionModelItem::exceptionSpecification() const { - m_isNoExcept = n; + return m_exceptionSpecification; +} + +void _FunctionModelItem::setExceptionSpecification(ExceptionSpecification e) +{ + m_exceptionSpecification = e; } bool _FunctionModelItem::isDeleted() const @@ -1116,7 +1121,7 @@ void _FunctionModelItem::setInvokable(bool isInvokable) void _FunctionModelItem::formatDebug(QDebug &d) const { _MemberModelItem::formatDebug(d); - d << ", type=" << m_functionType; + d << ", type=" << m_functionType << ", exspec=" << int(m_exceptionSpecification); if (m_isDeleted) d << " [deleted!]"; if (m_isInline) @@ -1133,8 +1138,6 @@ void _FunctionModelItem::formatDebug(QDebug &d) const d << " [abstract]"; if (m_isExplicit) d << " [explicit]"; - if (m_isNoExcept) - d << " [noexcept]"; if (m_isInvokable) d << " [invokable]"; formatModelItemList(d, ", arguments=", m_arguments); |