diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-09-02 11:11:32 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-09-02 15:41:54 +0000 |
commit | d74b13b286ccf7982208d3fe34827e8e9429a003 (patch) | |
tree | 484680104134ab873e492341fab76f0ee18a42ff | |
parent | 3b9850880416d331bd39ae7e07d1d08887b5e6f2 (diff) |
shiboken6: Check for "override" attribute in cases it is not spelled out
Task-number: PYSIDE-1653
Change-Id: If5860913dfa6cc5e67ade501f3becfc6a91c0f00
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r-- | sources/shiboken6/ApiExtractor/abstractmetalang.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.cpp b/sources/shiboken6/ApiExtractor/abstractmetalang.cpp index 95d33c519..c2d9bfcf6 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetalang.cpp +++ b/sources/shiboken6/ApiExtractor/abstractmetalang.cpp @@ -1433,6 +1433,14 @@ void AbstractMetaClass::fixFunctions() if (cmp & AbstractMetaFunction::EqualModifiedName) { add = false; if (cmp & AbstractMetaFunction::EqualArguments) { + // Set "override" in case it was not spelled out (since it + // is then not detected by clang parsing). + const auto attributes = cf->attributes(); + if (cf->isVirtual() + && !attributes.testFlag(AbstractMetaFunction::OverriddenCppMethod) + && !attributes.testFlag(AbstractMetaFunction::FinalCppMethod)) { + *f += AbstractMetaFunction::OverriddenCppMethod; + } // Same function, propegate virtual... if (!(cmp & AbstractMetaFunction::EqualAttributes)) { if (!f->isEmptyFunction()) { |