File tree 1 file changed +16
-5
lines changed
1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -233,11 +233,22 @@ impl TemplateInstantiation {
233
233
234
234
let template_args = ty. template_args ( )
235
235
. map_or ( vec ! [ ] , |args| {
236
- args. filter ( |t| t. kind ( ) != CXType_Invalid )
237
- . map ( |t| {
238
- Item :: from_ty_or_ref ( t, t. declaration ( ) , None , ctx)
239
- } )
240
- . collect ( )
236
+ match ty. canonical_type ( ) . template_args ( ) {
237
+ Some ( canonical_args) => {
238
+ let arg_count = args. len ( ) ;
239
+ args. chain ( canonical_args. skip ( arg_count) )
240
+ . filter ( |t| t. kind ( ) != CXType_Invalid )
241
+ . map ( |t| {
242
+ Item :: from_ty_or_ref ( t, t. declaration ( ) , None , ctx)
243
+ } ) . collect ( )
244
+ }
245
+ None => {
246
+ args. filter ( |t| t. kind ( ) != CXType_Invalid )
247
+ . map ( |t| {
248
+ Item :: from_ty_or_ref ( t, t. declaration ( ) , None , ctx)
249
+ } ) . collect ( )
250
+ }
251
+ }
241
252
} ) ;
242
253
243
254
let definition = ty. declaration ( )
You can’t perform that action at this time.
0 commit comments