Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cbc9eb1

Browse files
committed
Fix destructor name ...
There appears to be a pb in 9df8c9d. For a template class, A::B::C<T1,T2> the destructor name was C<T1,T2> leading to code like A::B::C<T1,T2>::~C<T1,T2>() which does not compile on gcc (4.6, 4.7), also it seems to be correct code ... clang and intel C++ compile it, but not gcc. I changed the name to generate the code : A::B::C<T1,T2>::~C() which compiles on gcc, clang, intel by further cutting the <...> in the destructor name.
1 parent e2e70dc commit cbc9eb1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Cython/Compiler/ModuleNode.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,7 @@ def generate_dealloc_function(self, scope, code):
11391139
# Make sure the namespace delimiter was not in a template arg.
11401140
while destructor_name.count('<') != destructor_name.count('>'):
11411141
destructor_name = split_cname.pop() + '::' + destructor_name
1142+
destructor_name = destructor_name.split('<',1)[0]
11421143
code.putln("p->%s.%s::~%s();" %
11431144
(entry.cname, entry.type.declaration_code(""), destructor_name))
11441145

0 commit comments

Comments
 (0)