parent
48a0d934a3
commit
4c1c506d21
|
@ -5010,7 +5010,7 @@ const Type* SymbolDatabase::findVariableType(const Scope *start, const Token *ty
|
||||||
// find start of qualified function name
|
// find start of qualified function name
|
||||||
const Token *tok1 = typeTok;
|
const Token *tok1 = typeTok;
|
||||||
|
|
||||||
while (Token::Match(tok1->tokAt(-2), "%type% ::") ||
|
while ((Token::Match(tok1->tokAt(-2), "%type% ::") && !tok1->tokAt(-2)->isKeyword()) ||
|
||||||
(Token::simpleMatch(tok1->tokAt(-2), "> ::") && tok1->linkAt(-2) && Token::Match(tok1->linkAt(-2)->tokAt(-1), "%type%"))) {
|
(Token::simpleMatch(tok1->tokAt(-2), "> ::") && tok1->linkAt(-2) && Token::Match(tok1->linkAt(-2)->tokAt(-1), "%type%"))) {
|
||||||
if (tok1->strAt(-1) == "::")
|
if (tok1->strAt(-1) == "::")
|
||||||
tok1 = tok1->tokAt(-2);
|
tok1 = tok1->tokAt(-2);
|
||||||
|
|
|
@ -3750,6 +3750,16 @@ private:
|
||||||
"}\n",
|
"}\n",
|
||||||
true);
|
true);
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
// #11472
|
||||||
|
check("namespace N {\n"
|
||||||
|
" struct T { int m; };\n"
|
||||||
|
" int i;\n"
|
||||||
|
" const T& f(const T* p) {\n"
|
||||||
|
" return p != nullptr ? *p : *reinterpret_cast<const ::N::T*>(&i);\n"
|
||||||
|
" }\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void danglingLifetimeBorrowedMembers()
|
void danglingLifetimeBorrowedMembers()
|
||||||
|
|
Loading…
Reference in New Issue