SymbolDatabase: set value type for std::move()
This commit is contained in:
parent
4e525e52ec
commit
7294145797
|
@ -5056,6 +5056,11 @@ void SymbolDatabase::setValueType(Token *tok, const ValueType &valuetype)
|
||||||
setValueType(parent, vt);
|
setValueType(parent, vt);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// std::move
|
||||||
|
if (vt2 && parent->str() == "(" && Token::simpleMatch(parent->tokAt(-3), "std :: move (")) {
|
||||||
|
setValueType(parent, valuetype);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (parent->str() == "*" && !parent->astOperand2() && valuetype.pointer > 0U) {
|
if (parent->str() == "*" && !parent->astOperand2() && valuetype.pointer > 0U) {
|
||||||
ValueType vt(valuetype);
|
ValueType vt(valuetype);
|
||||||
vt.pointer -= 1U;
|
vt.pointer -= 1U;
|
||||||
|
|
|
@ -6261,6 +6261,8 @@ private:
|
||||||
ASSERT_EQUALS("signed int", typeOf("auto a(int) -> int; a(5);", "( 5"));
|
ASSERT_EQUALS("signed int", typeOf("auto a(int) -> int; a(5);", "( 5"));
|
||||||
ASSERT_EQUALS("unsigned long", typeOf("sizeof(x);", "("));
|
ASSERT_EQUALS("unsigned long", typeOf("sizeof(x);", "("));
|
||||||
ASSERT_EQUALS("signed int", typeOf("int (*a)(int); a(5);", "( 5"));
|
ASSERT_EQUALS("signed int", typeOf("int (*a)(int); a(5);", "( 5"));
|
||||||
|
// Some standard template functions.. TODO library configuration
|
||||||
|
ASSERT_EQUALS("signed int", typeOf("std::move(5);", "( 5 )"));
|
||||||
|
|
||||||
// struct member..
|
// struct member..
|
||||||
ASSERT_EQUALS("signed int", typeOf("struct AB { int a; int b; } ab; x = ab.a;", "."));
|
ASSERT_EQUALS("signed int", typeOf("struct AB { int a; int b; } ab; x = ab.a;", "."));
|
||||||
|
|
Loading…
Reference in New Issue