ValueType: Set ValueType for constructor calls
This commit is contained in:
parent
267d23f1b8
commit
bf61bcf402
|
@ -5640,11 +5640,11 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings)
|
|||
setValueType(tok, valuetype);
|
||||
}
|
||||
|
||||
// constructor
|
||||
else if (tok->previous() && tok->previous()->type() && tok->previous()->type()->classScope) {
|
||||
// constructor call
|
||||
else if (tok->previous() && tok->previous()->function() && tok->previous()->function()->isConstructor()) {
|
||||
ValueType valuetype;
|
||||
valuetype.type = ValueType::RECORD;
|
||||
valuetype.typeScope = tok->previous()->type()->classScope;
|
||||
valuetype.typeScope = tok->previous()->function()->token->scope();
|
||||
setValueType(tok, valuetype);
|
||||
}
|
||||
|
||||
|
|
|
@ -6416,6 +6416,7 @@ 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"));
|
||||
ASSERT_EQUALS("s", typeOf("struct s { s foo(); s(int, int); }; s s::foo() { return s(1, 2); } ", "( 1 , 2 )"));
|
||||
// Some standard template functions.. TODO library configuration
|
||||
ASSERT_EQUALS("signed int", typeOf("std::move(5);", "( 5 )"));
|
||||
|
||||
|
|
Loading…
Reference in New Issue