aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/shiboken2
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-05-22 10:22:02 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-05-29 09:46:19 +0000
commitb72e4d6bcfb1335ee6dcad9ab30e429b62b8e6e1 (patch)
tree4c329f649dd14fd89f51ab4382774b9bb199d883 /sources/shiboken2/generator/shiboken2
parent16e5f4710e16aec6c46e3f9736f0be3cef3a537d (diff)
Remove AbstractMetaFunction::invalid()
Change AbstractMetaBuilderPrivate::traverseFunction() to consistently return 0 if something does not fit. Previously, functions with half-parsed arguments with the invalid flag set were returned. This caused strange side effects since the flag was not checked in all places. The only relevant information is whether some constructors were rejected. In that case, no default constructors or default copy constructors should be generated. This is now determined by checking the code model function item; the attribute HasRejectConstructor is introduced for this. This fixes: - Make it possible to reject the QTextStreamManipulator constructor taking a function pointer without having a default constructor generated: typedef void (QTextStream::*QTSMFI)(int); QTextStreamManipulator(QTSMFI m, int a) Q_DECL_NOTHROW - Implement QtCharts whose class QAbstractSeries has a rejected constructor. Change-Id: I6310574ba677dac20699f257340d2c2a55674353 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/generator/shiboken2')
-rw-r--r--sources/shiboken2/generator/shiboken2/shibokengenerator.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
index 4768ddc88..fb9946be1 100644
--- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
@@ -1004,6 +1004,8 @@ bool ShibokenGenerator::isValueTypeWithCopyConstructorOnly(const AbstractMetaCla
{
if (!metaClass || !metaClass->typeEntry()->isValue())
return false;
+ if ((metaClass->attributes() & AbstractMetaAttributes::HasRejectedConstructor) != 0)
+ return false;
AbstractMetaFunctionList ctors = metaClass->queryFunctions(AbstractMetaClass::Constructors);
if (ctors.count() != 1)
return false;