Fix 9444: Syntax error on valid C++14 code (#3403)
This commit is contained in:
parent
6d65f86871
commit
422e411b6c
|
@ -4501,7 +4501,7 @@ void Tokenizer::createLinks2()
|
|||
|
||||
while (!type.empty() && type.top()->str() == "<") {
|
||||
const Token* end = type.top()->findClosingBracket();
|
||||
if (Token::Match(end, "> %comp%|;|.|=|{"))
|
||||
if (Token::Match(end, "> %comp%|;|.|=|{|::"))
|
||||
break;
|
||||
// Variable declaration
|
||||
if (Token::Match(end, "> %var% ;") && (type.top()->tokAt(-2) == nullptr || Token::Match(type.top()->tokAt(-2), ";|}|{")))
|
||||
|
|
|
@ -6604,6 +6604,14 @@ private:
|
|||
" }\n"
|
||||
"};\n"));
|
||||
|
||||
// #9444
|
||||
ASSERT_NO_THROW(tokenizeAndStringify("template <int> struct a;\n"
|
||||
"template <long b> using c = a<b>;\n"
|
||||
"template <long b> c<b> d;\n"
|
||||
"template <typename> struct e {\n"
|
||||
" template <typename... f> void g() const { d<e<f &&...>::h>; }\n"
|
||||
"};\n"));
|
||||
|
||||
// #9858
|
||||
ASSERT_NO_THROW(tokenizeAndStringify(
|
||||
"struct a {\n"
|
||||
|
|
Loading…
Reference in New Issue