parent
fa651272f0
commit
1b89c998f5
|
@ -7092,7 +7092,14 @@ ValueType::MatchResult ValueType::matchParameter(const ValueType *call, const Va
|
||||||
|
|
||||||
ValueType::MatchResult ValueType::matchParameter(const ValueType *call, const Variable *callVar, const Variable *funcVar)
|
ValueType::MatchResult ValueType::matchParameter(const ValueType *call, const Variable *callVar, const Variable *funcVar)
|
||||||
{
|
{
|
||||||
ValueType::MatchResult res = ValueType::matchParameter(call, funcVar->valueType());
|
ValueType vt;
|
||||||
|
const ValueType* pvt = funcVar->valueType();
|
||||||
|
if (pvt && funcVar->isArray()) {
|
||||||
|
vt = *pvt;
|
||||||
|
++vt.pointer;
|
||||||
|
pvt = &vt;
|
||||||
|
}
|
||||||
|
ValueType::MatchResult res = ValueType::matchParameter(call, pvt);
|
||||||
if (callVar && ((res == ValueType::MatchResult::SAME && call->container) || res == ValueType::MatchResult::UNKNOWN)) {
|
if (callVar && ((res == ValueType::MatchResult::SAME && call->container) || res == ValueType::MatchResult::UNKNOWN)) {
|
||||||
const std::string type1 = getTypeString(callVar->typeStartToken());
|
const std::string type1 = getTypeString(callVar->typeStartToken());
|
||||||
const std::string type2 = getTypeString(funcVar->typeStartToken());
|
const std::string type2 = getTypeString(funcVar->typeStartToken());
|
||||||
|
|
|
@ -3305,6 +3305,18 @@ private:
|
||||||
" {}\n"
|
" {}\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
check("struct String {\n" // #10469
|
||||||
|
" void Append(uint8_t Val);\n"
|
||||||
|
" String& operator+=(const char s[]);\n"
|
||||||
|
" String& operator+=(const std::string& Str) {\n"
|
||||||
|
" return operator+=(Str.c_str());\n"
|
||||||
|
" }\n"
|
||||||
|
" void operator+=(uint8_t Val) {\n"
|
||||||
|
" Append(Val);\n"
|
||||||
|
" }\n"
|
||||||
|
"};\n");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void danglingLifetimeBorrowedMembers()
|
void danglingLifetimeBorrowedMembers()
|
||||||
|
|
Loading…
Reference in New Issue