| 359 | } |
| 360 | |
| 361 | bool isMatchingArgumentType ( TypeInfo * argType, TypeInfo * passType) { |
| 362 | if (!passType) { |
| 363 | return false; |
| 364 | } |
| 365 | if ( argType->type==Type::anyArgument ) { |
| 366 | return true; |
| 367 | } |
| 368 | // compare types which don't need inference |
| 369 | auto tempMatters = argType->isImplicit() ? TemporaryMatters::no : TemporaryMatters::yes; |
| 370 | if ( !isSameType(argType, passType, RefMatters::no, ConstMatters::no, tempMatters, true) ) { |
| 371 | return false; |
| 372 | } |
| 373 | // can't pass non-ref to ref |
| 374 | if ( argType->isRef() && !passType->isRef() ) { |
| 375 | return false; |
| 376 | } |
| 377 | // ref types can only add constness |
| 378 | if (argType->isRef() && !argType->isConst() && passType->isConst()) { |
| 379 | return false; |
| 380 | } |
| 381 | // pointer types can only add constant |
| 382 | if (isPointer(argType) && !argType->isConst() && passType->isConst()) { |
| 383 | return false; |
| 384 | } |
| 385 | // all good |
| 386 | return true; |
| 387 | } |
| 388 | |
| 389 | bool isSameType ( const TypeInfo * THIS, |
| 390 | const TypeInfo * decl, |
nothing calls this directly
no test coverage detected