diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-06-08 08:47:54 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-06-09 11:16:03 +0200 |
commit | 783720fdb308a686610b4f70e839930b60970362 (patch) | |
tree | 2bf69658525994ef9c7f53aae8a08497ec718c78 /sources/shiboken6/ApiExtractor/abstractmetalang.h | |
parent | 71d940b4d426e19b39843e773e345a5147cf9cc5 (diff) |
shiboken6: Fix increment/decrement operators
For classes that have increment/decrement operators
(++/--), shiboken6 generated operators +=/-= ( __iadd__/__isub__)
by calling them n times. This was mainly intended for iterators.
However, when both operator++/-- and operator+=/-= were present (as
introduced by qtdeclarative/f8f31dd0e1f9425ba272691c79e719ebc4bcfb94
for QJSPrimitiveValue), duplicate code and errors were generated.
This requires filtering of the operator functions.
Introduce a separate function type for increment/decrement operators
and remove them if operators +=/-= were found. Also, when
both prefix and postfix version of the increment/decrement operators
are found, remove one.
Extend existing class IntWrapper from libsample for testing.
Add explanatory comment and use prefix increment.
Pick-to: 6.1
Change-Id: I0f8a0c79a6f74974ba327d21f35fff74962ffd3a
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/abstractmetalang.h')
-rw-r--r-- | sources/shiboken6/ApiExtractor/abstractmetalang.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.h b/sources/shiboken6/ApiExtractor/abstractmetalang.h index f83062dd7..daa9eba1e 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetalang.h +++ b/sources/shiboken6/ApiExtractor/abstractmetalang.h @@ -166,6 +166,7 @@ public: AbstractMetaFunctionCList operatorOverloads(OperatorQueryOptions query) const; bool hasArithmeticOperatorOverload() const; + bool hasIncDecrementOperatorOverload() const; bool hasBitwiseOperatorOverload() const; bool hasComparisonOperatorOverload() const; bool hasLogicalOperatorOverload() const; |