File tree Expand file tree Collapse file tree 4 files changed +12
-11
lines changed Expand file tree Collapse file tree 4 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 1+ class A {
2+ class I ;
3+ };
4+
5+ class A ::I {
6+ int i;
7+ };
Original file line number Diff line number Diff line change @@ -1211,11 +1211,11 @@ impl Type {
12111211
12121212 /// Get a cursor pointing to this type's declaration.
12131213 pub ( crate ) fn declaration ( & self ) -> Cursor {
1214- unsafe {
1215- Cursor {
1216- x : clang_getTypeDeclaration ( self . x ) ,
1217- }
1218- }
1214+ let decl = Cursor {
1215+ x : unsafe { clang_getTypeDeclaration ( self . x ) } ,
1216+ } ;
1217+ // Prior to clang 22, the declaration pointed to the definition.
1218+ decl . definition ( ) . unwrap_or ( decl )
12191219 }
12201220
12211221 /// Get the canonical declaration of this type, if it is available.
Original file line number Diff line number Diff line change @@ -1234,12 +1234,6 @@ impl CompInfo {
12341234 ) ;
12351235
12361236 let mut cursor = ty. declaration ( ) ;
1237-
1238- // If there is a definition, that's what we want.
1239- if let Some ( def) = cursor. definition ( ) {
1240- cursor = def;
1241- }
1242-
12431237 let mut kind = Self :: kind_from_cursor ( & cursor) ;
12441238 if kind. is_err ( ) {
12451239 if let Some ( location) = location {
You can’t perform that action at this time.
0 commit comments