Skip to content

Commit d0854f7

Browse files
author
roman_yakovenko
committed
fixing small bug: return types could be same type
1 parent 58787cc commit d0854f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pygccxml/declarations/function_traits.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def is_same_return_type( f1, f2 ):
2727
# cv-qualification than the class type in the return type of B::f.
2828

2929
if not f1.__class__ is f2.__class__:
30+
#it should be assert
3031
return False #2 different calldef types
3132
if not isinstance( f1, calldef.member_calldef_t ):
3233
#for free functions we compare return types as usual
@@ -58,7 +59,8 @@ def is_same_return_type( f1, f2 ):
5859
if c1.class_type == class_declaration.CLASS_TYPES.UNION \
5960
or c2.class_type == class_declaration.CLASS_TYPES.UNION:
6061
return type_traits.is_same( rt1, rt2 )
61-
return type_traits.is_base_and_derived( c1, c2 ) \
62+
return type_traits.is_same( c1, c2 ) \
63+
or type_traits.is_base_and_derived( c1, c2 ) \
6264
or type_traits.is_base_and_derived( c2, c1 )
6365

6466

0 commit comments

Comments
 (0)