parent
f61003d954
commit
1fa785d81d
|
@ -2350,8 +2350,6 @@ std::pair<const Token*, const Token*> Token::typeDecl(const Token* tok, bool poi
|
|||
varTok = varTok->next();
|
||||
while (Token::Match(varTok, "%name% ::"))
|
||||
varTok = varTok->tokAt(2);
|
||||
if (Token::simpleMatch(varTok, "(") && Token::simpleMatch(varTok->astOperand1(), "."))
|
||||
varTok = varTok->astOperand1()->astOperand1();
|
||||
std::pair<const Token*, const Token*> r = typeDecl(varTok);
|
||||
if (r.first)
|
||||
return r;
|
||||
|
|
|
@ -292,6 +292,18 @@ private:
|
|||
" return nullptr;\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("struct S {\n" // #12159
|
||||
" std::future<int> f() const {\n"
|
||||
" return {};\n"
|
||||
" }\n"
|
||||
"};\n"
|
||||
"int g() {\n"
|
||||
" std::shared_ptr<S> s = std::make_shared<S>();\n"
|
||||
" auto x = s->f();\n"
|
||||
" return x.get();\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -8970,8 +8970,8 @@ private:
|
|||
|
||||
const Token* tok = tokenizer.tokens();
|
||||
tok = Token::findsimplematch(tok, "auto r");
|
||||
ASSERT(tok && tok->valueType());
|
||||
ASSERT_EQUALS("container(std :: string|wstring|u16string|u32string)", tok->valueType()->str());
|
||||
ASSERT(tok);
|
||||
TODO_ASSERT(tok->valueType() && "container(std :: string|wstring|u16string|u32string)" == tok->valueType()->str());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue