@@ -46,8 +46,8 @@ import contract;
46
46
47
47
const baseSpec = derived.child(0 );
48
48
baseSpec.kind.should == Cursor.Kind.CXXBaseSpecifier;
49
- baseSpec.spelling.should == " struct Base" ;
50
- baseSpec.type.kind.should == Type.Kind.Record ;
49
+ baseSpec.spelling.should.be in [ " struct Base" , " Base " ] ;
50
+ baseSpec.type.kind.should.be in [ Type.Kind.Record , Type.Kind.Elaborated] ;
51
51
baseSpec.type.spelling.should == " Base" ;
52
52
53
53
printChildren(baseSpec);
@@ -109,7 +109,8 @@ import contract;
109
109
const baseSpec = derived.child(0 );
110
110
baseSpec.kind.should == Cursor.Kind.CXXBaseSpecifier;
111
111
baseSpec.spelling.should == " Base<int>" ;
112
- baseSpec.type.kind.should == Type.Kind.Unexposed; // because it's a template
112
+ // because it's a template
113
+ baseSpec.type.kind.should.be in [Type.Kind.Unexposed, Type.Kind.Elaborated /* libclang17*/ ];
113
114
baseSpec.type.spelling.should == " Base<int>" ;
114
115
// Here's where the weirdness starts. We try and get back to the original
115
116
// ClassTemplate cursor here via the baseSpec type, but instead we get a
@@ -165,8 +166,16 @@ import contract;
165
166
derived.children.length.should == 3 ;
166
167
167
168
const baseSpec0 = derived.child(0 );
168
- baseSpec0.shouldMatch(Cursor.Kind.CXXBaseSpecifier, " struct Base0" );
169
- baseSpec0.type.shouldMatch(Type.Kind.Record , " Base0" );
169
+ try
170
+ baseSpec0.shouldMatch(Cursor.Kind.CXXBaseSpecifier, " struct Base0" );
171
+ catch (Exception _) // libclang17
172
+ baseSpec0.shouldMatch(Cursor.Kind.CXXBaseSpecifier, " Base0" );
173
+
174
+ try
175
+ baseSpec0.type.shouldMatch(Type.Kind.Record , " Base0" );
176
+ catch (Exception _) // libclang17
177
+ baseSpec0.type.shouldMatch(Type.Kind.Elaborated, " Base0" );
178
+
170
179
printChildren(baseSpec0);
171
180
baseSpec0.children.length.should == 1 ;
172
181
@@ -176,8 +185,16 @@ import contract;
176
185
typeRef0.children.length.should == 0 ;
177
186
178
187
const baseSpec1 = derived.child(1 );
179
- baseSpec1.shouldMatch(Cursor.Kind.CXXBaseSpecifier, " struct Base1" );
180
- baseSpec1.type.shouldMatch(Type.Kind.Record , " Base1" );
188
+ try
189
+ baseSpec1.shouldMatch(Cursor.Kind.CXXBaseSpecifier, " struct Base1" );
190
+ catch (Exception _) // libclang17
191
+ baseSpec1.shouldMatch(Cursor.Kind.CXXBaseSpecifier, " Base1" );
192
+
193
+ try
194
+ baseSpec1.type.shouldMatch(Type.Kind.Record , " Base1" );
195
+ catch (Exception _)
196
+ baseSpec1.type.shouldMatch(Type.Kind.Elaborated, " Base1" );
197
+
181
198
printChildren(baseSpec1);
182
199
baseSpec1.children.length.should == 1 ;
183
200
0 commit comments