Skip to content

Commit 3662f2a

Browse files
committed
Fix published static class members not being wrapped
1 parent d43bd10 commit 3662f2a

4 files changed

Lines changed: 118 additions & 5 deletions

File tree

src/interrogate/interrogateBuilder.cxx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,11 +1351,6 @@ scan_element(CPPInstance *element, CPPStructType *struct_type,
13511351
return 0;
13521352
}
13531353

1354-
if ((element->_storage_class & CPPInstance::SC_static) != 0) {
1355-
// The element is static, so can't be exported.
1356-
return 0;
1357-
}
1358-
13591354
// Make sure the element knows what its scope is.
13601355
if (element->_ident->_native_scope != scope) {
13611356
element = new CPPInstance(*element);

tests/interrogatedb/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ endfunction()
2222

2323
idb_test(item_assignment.h)
2424
idb_test(nested_struct.h)
25+
idb_test(static_class_member.h)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//FLAGS: -D__cplusplus -python-native
2+
3+
class Type {
4+
__published:
5+
static const int global_const = 1;
6+
static Type *global_ptr;
7+
};
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
version: 3.3
2+
3+
index:
4+
- wrapper for Type::Type
5+
- wrapper for Type::Type
6+
- function Type::get_global_const
7+
- function Type::get_global_ptr
8+
- function Type::set_global_ptr
9+
- function Type::Type
10+
- function Type::~Type
11+
- type Type
12+
- type int
13+
- type Type *
14+
- type Type const *
15+
- type Type const
16+
- element Type::global_const
17+
- element Type::global_ptr
18+
19+
type "Type" {
20+
flags: global class fully_defined implicit_destructor
21+
22+
constructor: Type
23+
destructor: ~Type
24+
element: global_const
25+
element: global_ptr
26+
}
27+
28+
type "Type *" {
29+
flags: wrapped pointer fully_defined
30+
wrapped_type: Type
31+
}
32+
33+
type "Type const" {
34+
flags: wrapped const fully_defined
35+
wrapped_type: Type
36+
}
37+
38+
type "Type const *" {
39+
flags: wrapped pointer fully_defined
40+
wrapped_type: Type const
41+
}
42+
43+
function "Type::Type" {
44+
flags: method constructor
45+
prototype:
46+
inline Type::Type(void) = default;
47+
inline Type::Type(Type const &) = default;
48+
49+
python wrapper {
50+
flags: caller_manages has_return
51+
return_type: Type *
52+
}
53+
python wrapper {
54+
flags: caller_manages has_return copy_constructor
55+
return_type: Type *
56+
57+
parameter: Type const *
58+
}
59+
}
60+
61+
function "Type::get_global_const" {
62+
flags: method getter
63+
expression: "Type::global_const"
64+
prototype:
65+
static int Type::get_global_const(void);
66+
comment:
67+
getter for static int const Type::global_const;
68+
}
69+
70+
function "Type::get_global_ptr" {
71+
flags: method getter
72+
expression: "Type::global_ptr"
73+
prototype:
74+
static Type *Type::get_global_ptr(void);
75+
comment:
76+
getter for static Type *Type::global_ptr;
77+
}
78+
79+
element "Type::global_const" {
80+
type: int
81+
flags: has_getter
82+
getter: Type::get_global_const
83+
}
84+
85+
element "Type::global_ptr" {
86+
type: Type *
87+
flags: has_getter has_setter
88+
getter: Type::get_global_ptr
89+
setter: Type::set_global_ptr
90+
}
91+
92+
function "Type::set_global_ptr" {
93+
flags: method setter
94+
expression: "Type::global_ptr"
95+
prototype:
96+
static void Type::set_global_ptr(Type *value);
97+
comment:
98+
setter for static Type *Type::global_ptr;
99+
}
100+
101+
function "Type::~Type" {
102+
flags: method destructor
103+
prototype:
104+
Type::~Type(void);
105+
}
106+
107+
type "int" {
108+
flags: atomic fully_defined
109+
atomic_token: int
110+
}

0 commit comments

Comments
 (0)