| 5981 | } |
| 5982 | |
| 5983 | static bool hasMatchingConstructor(const Scope* classScope, const ValueType* argType) { |
| 5984 | if (!classScope || !argType) |
| 5985 | return false; |
| 5986 | return std::any_of(classScope->functionList.cbegin(), |
| 5987 | classScope->functionList.cend(), |
| 5988 | [&](const Function& f) { |
| 5989 | if (!f.isConstructor() || f.argCount() != 1 || !f.getArgumentVar(0)) |
| 5990 | return false; |
| 5991 | const ValueType* vt = f.getArgumentVar(0)->valueType(); |
| 5992 | return vt && |
| 5993 | vt->type == argType->type && |
| 5994 | (argType->sign == ValueType::Sign::UNKNOWN_SIGN || vt->sign == argType->sign) && |
| 5995 | vt->pointer == argType->pointer && |
| 5996 | (vt->constness & 1) >= (argType->constness & 1) && |
| 5997 | (vt->volatileness & 1) >= (argType->volatileness & 1); |
| 5998 | }); |
| 5999 | } |
| 6000 | |
| 6001 | const Function* Scope::findFunction(const Token *tok, bool requireConst, Reference ref) const |
| 6002 | { |
no test coverage detected