Skip to content

Commit 724dea8

Browse files
committed
Extend the map test for gcc (see #55)
Calling create_decl_string on the _M_clone_node calldef is failing with gcc > 4.9 and -std=c++11 This test should is currently failing, it is only there to have a way to demonstrate the error and to fix it.
1 parent 54201e5 commit 724dea8

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

unittests/test_map_gcc5.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,26 @@ def test_map_gcc5(self):
2121
"""
2222
The code in test_map_gcc5.hpp was breaking pygccxml.
2323
24-
Test that case (gcc5 + castxml + c++11). See issue #45
24+
Test that case (gcc5 + castxml + c++11).
25+
26+
See issue #45 and #55
2527
2628
"""
2729

2830
if self.config.xml_generator == "gccxml":
2931
return
3032

3133
decls = parser.parse([self.header], self.config)
32-
self.global_ns = declarations.get_global_namespace(decls)
34+
global_ns = declarations.get_global_namespace(decls)
35+
36+
# This calldef is defined with gcc > 4.9 (maybe earlier, not tested)
37+
# and -std=c++11. Calling create_decl_string is failing with gcc.
38+
# With clang the calldef does not exist so the matche
39+
# will just return an empty list, letting the test pass.
40+
criteria = declarations.calldef_matcher(name="_M_clone_node")
41+
free_funcs = declarations.matcher.find(criteria, global_ns)
42+
for free_funcs in free_funcs:
43+
print(free_funcs.create_decl_string(with_defaults=False))
3344

3445

3546
def create_suite():

0 commit comments

Comments
 (0)