diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index b12f3a9b3..8eaeed7e6 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -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) diff --git a/test/cli/test-clang-import.py b/test/cli/test-clang-import.py index 5330ddde2..073404a5a 100644 --- a/test/cli/test-clang-import.py +++ b/test/cli/test-clang-import.py @@ -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(); }')