Proper fix for test-clang-import.py failure

This commit is contained in:
Daniel Marjamäki 2020-11-07 18:12:47 +01:00
parent b8e0cdcdb4
commit 1c2e480449
2 changed files with 5 additions and 3 deletions

View File

@ -6249,6 +6249,10 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to
vt.sign = (vt.type == ValueType::Type::CHAR) ? mDefaultSignedness : ValueType::Sign::SIGNED;
}
setValueType(tok, vt);
if (Token::simpleMatch(tok->astOperand1(), "(")) {
vt.pointer--;
setValueType(tok->astOperand1(), vt);
}
} else if (tok->isKeyword() && tok->str() == "return" && tok->scope()) {
const Scope* fscope = tok->scope();
while (fscope && !fscope->function)

View File

@ -118,7 +118,5 @@ def test_ast_control_flow():
check_ast('void foo(int a, int b, int c) { foo(a,b,c); }')
def test_ast():
# TODO
#check_ast('struct S { int x; }; S* foo() { return new S(); }')
pass
check_ast('struct S { int x; }; S* foo() { return new S(); }')