Fixed #3912 (Analysis failed)
This commit is contained in:
parent
2de6ea4627
commit
f72ddbb2e9
|
@ -2955,7 +2955,7 @@ void Tokenizer::createLinks2()
|
|||
} else if (token->str() == ">" || token->str() == ">>") {
|
||||
if (links.empty()) // < and > don't match.
|
||||
continue;
|
||||
if (token->next() && !token->next()->isName() && !Token::Match(token->next(), ">|&|*|::|,|("))
|
||||
if (token->next() && !token->next()->isName() && !Token::Match(token->next(), ">|&|*|::|,|(|)"))
|
||||
continue;
|
||||
|
||||
// Check type of open link
|
||||
|
|
|
@ -324,6 +324,7 @@ private:
|
|||
TEST_CASE(vardecl_template_2);
|
||||
TEST_CASE(vardecl_union);
|
||||
TEST_CASE(vardecl_par); // #2743 - set links if variable type contains parentheses
|
||||
TEST_CASE(vardecl_par2) // #3912 - set correct links
|
||||
TEST_CASE(volatile_variables);
|
||||
TEST_CASE(syntax_error);
|
||||
TEST_CASE(syntax_error_templates_1);
|
||||
|
@ -4738,6 +4739,17 @@ private:
|
|||
ASSERT_EQUALS(true, tokenizer.validate());
|
||||
}
|
||||
|
||||
void vardecl_par2() {
|
||||
// ticket #3912 - set correct links
|
||||
const char code[] = "function<void (shared_ptr<MyClass>)> v;";
|
||||
|
||||
Settings settings;
|
||||
Tokenizer tokenizer(&settings, this);
|
||||
std::istringstream istr(code);
|
||||
tokenizer.tokenize(istr, "test.cpp", "", false);
|
||||
ASSERT_EQUALS(true, tokenizer.validate());
|
||||
}
|
||||
|
||||
void vardec_static() {
|
||||
{
|
||||
// don't simplify declarations of static variables
|
||||
|
|
Loading…
Reference in New Issue