aboutsummaryrefslogtreecommitdiff
path: root/tests/GenerateSipBindings/cpplib.h
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2017-01-14 22:13:49 +0000
committerStephen Kelly <steveire@gmail.com>2017-01-15 11:18:50 +0000
commit636d6acc7adf8bf7169d38833340161dc42d3484 (patch)
tree2ff1bbefa5808aec21e902b10c9547e359067604 /tests/GenerateSipBindings/cpplib.h
parent8c347c61abafa68e247ff4664ae658cfa15af932 (diff)
downloadextra-cmake-modules-636d6acc7adf8bf7169d38833340161dc42d3484.tar.gz
extra-cmake-modules-636d6acc7adf8bf7169d38833340161dc42d3484.tar.bz2
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.
Diffstat (limited to 'tests/GenerateSipBindings/cpplib.h')
-rw-r--r--tests/GenerateSipBindings/cpplib.h26
1 files changed, 23 insertions, 3 deletions
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 <functional>
-class FwdDecl;
+class ExternalFwdDecl;
+class LocalFwdDecl;
+
+template<typename T> 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<int>& l);
+
+ int localDeclListDecl(const QList<LocalFwdDecl>& 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: