File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ impl Cursor {
56
56
}
57
57
58
58
pub fn mangling ( & self ) -> String {
59
- unsafe {
59
+ unsafe {
60
60
String_ { x : clang_Cursor_getMangling ( self . x ) } . to_string ( )
61
61
}
62
62
}
@@ -136,6 +136,14 @@ impl Cursor {
136
136
self . specialized ( ) . is_valid ( )
137
137
}
138
138
139
+ pub fn is_in_template ( & self ) -> bool {
140
+ if self . is_toplevel ( ) {
141
+ return false ;
142
+ }
143
+ let parent = self . semantic_parent ( ) ;
144
+ parent. is_template ( ) || parent. is_in_template ( )
145
+ }
146
+
139
147
pub fn is_valid ( & self ) -> bool {
140
148
unsafe {
141
149
clang_isInvalid ( self . kind ( ) ) == 0
Original file line number Diff line number Diff line change @@ -75,6 +75,10 @@ fn get_abi(cc: Enum_CXCallingConv) -> abi::Abi {
75
75
}
76
76
77
77
pub fn cursor_mangling ( cursor : & clang:: Cursor ) -> Option < String > {
78
+ if cursor. is_in_template ( ) {
79
+ return None ;
80
+ }
81
+
78
82
let mut mangling = cursor. mangling ( ) ;
79
83
80
84
// Try to undo backend linkage munging (prepended _, generally)
You can’t perform that action at this time.
0 commit comments