SymbolDatabase: Better valuetype handling of container addition
This commit is contained in:
parent
f131a99ae3
commit
87f65230ae
|
@ -5348,6 +5348,11 @@ void SymbolDatabase::setValueType(Token *tok, const ValueType &valuetype)
|
||||||
setValueType(parent, *vt1);
|
setValueType(parent, *vt1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parent->str() == "+" && vt1->type == ValueType::Type::CONTAINER && vt2 && vt2->type == ValueType::Type::CONTAINER && vt1->container == vt2->container) {
|
||||||
|
setValueType(parent, *vt1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vt1->isIntegral() && vt1->pointer == 0U &&
|
if (vt1->isIntegral() && vt1->pointer == 0U &&
|
||||||
|
|
|
@ -6619,6 +6619,7 @@ private:
|
||||||
set.library.containers["test::string"] = string;
|
set.library.containers["test::string"] = string;
|
||||||
ASSERT_EQUALS("signed int", typeOf("Vector<int> v; v[0]=3;", "[", "test.cpp", &set));
|
ASSERT_EQUALS("signed int", typeOf("Vector<int> v; v[0]=3;", "[", "test.cpp", &set));
|
||||||
ASSERT_EQUALS("container(test :: string)", typeOf("void foo(Vector<test::string> v) { for (auto s: v) { x=s+s; } }", "s", "test.cpp", &set));
|
ASSERT_EQUALS("container(test :: string)", typeOf("void foo(Vector<test::string> v) { for (auto s: v) { x=s+s; } }", "s", "test.cpp", &set));
|
||||||
|
ASSERT_EQUALS("container(test :: string)", typeOf("void foo(Vector<test::string> v) { for (auto s: v) { x=s+s; } }", "+", "test.cpp", &set));
|
||||||
}
|
}
|
||||||
|
|
||||||
// new
|
// new
|
||||||
|
|
Loading…
Reference in New Issue