diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 01713b413..316238166 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -5056,6 +5056,11 @@ void SymbolDatabase::setValueType(Token *tok, const ValueType &valuetype) setValueType(parent, vt); 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) { ValueType vt(valuetype); vt.pointer -= 1U; diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp index deda11a39..051564534 100644 --- a/test/testsymboldatabase.cpp +++ b/test/testsymboldatabase.cpp @@ -6261,6 +6261,8 @@ private: ASSERT_EQUALS("signed int", typeOf("auto a(int) -> int; a(5);", "( 5")); ASSERT_EQUALS("unsigned long", typeOf("sizeof(x);", "(")); 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.. ASSERT_EQUALS("signed int", typeOf("struct AB { int a; int b; } ab; x = ab.a;", "."));