From 636d6acc7adf8bf7169d38833340161dc42d3484 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 14 Jan 2017 22:13:49 +0000 Subject: Bindings: Fix handling of forward declarations It is not appropriate to decorate each forward declaration with the SIP attribute /External/. That is only needed for forward declarations of types which are defined in a different module. Local forward declarations can be omitted from the sip code. In sip code, a forward declaration followed later by a full class definition is an error. Omit forward declarations unless they are decorated with the external attribute. Introduce a rules database for consumers to decorate them with the attribute as required. --- tests/GenerateSipBindings/cpplib.h | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'tests/GenerateSipBindings/cpplib.h') diff --git a/tests/GenerateSipBindings/cpplib.h b/tests/GenerateSipBindings/cpplib.h index 9b9adcba..3ae9448a 100644 --- a/tests/GenerateSipBindings/cpplib.h +++ b/tests/GenerateSipBindings/cpplib.h @@ -10,7 +10,10 @@ #include -class FwdDecl; +class ExternalFwdDecl; +class LocalFwdDecl; + +template class QList; class MyObject : public QObject { @@ -46,8 +49,14 @@ public: int const_parameters(const int input, QObject* const obj = 0) const; - int fwdDecl(const FwdDecl& f); - int fwdDeclRef(FwdDecl& f); + int externalFwdDecl(const ExternalFwdDecl& f); + int externalFwdDeclRef(ExternalFwdDecl& f); + + int localFwdDecl(const LocalFwdDecl& f); + + int localListDecl(const QList& l); + + int localDeclListDecl(const QList& l); mode_t dummyFunc(QObject* parent) { return 0; } @@ -77,6 +86,17 @@ private Q_SLOTS: void privateSlot2(); }; +class LocalFwdDecl +{ +public: + LocalFwdDecl(int value); + + int getValue() const; + +private: + int m_value; +}; + class NonCopyable { public: -- cgit v1.2.1