Fix 10651: Crash on static template method (#3633)
This commit is contained in:
parent
e8260f2dcc
commit
ac4f4258a0
|
@ -2221,7 +2221,7 @@ void TemplateSimplifier::expandTemplate(
|
|||
mTokenList.addtoken(tokSemicolon, tokSemicolon->linenr(), tokSemicolon->column(), tokSemicolon->fileIndex());
|
||||
}
|
||||
brackets.pop();
|
||||
if (brackets.empty() && !Token::Match(tok3, "} >|,|{|%cop%")) {
|
||||
if (brackets.empty() && !Token::Match(tok3, "} >|,|{")) {
|
||||
inTemplateDefinition = false;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -6765,6 +6765,13 @@ private:
|
|||
// #9301
|
||||
ASSERT_NO_THROW(tokenizeAndStringify("template <typename> constexpr char x[] = \"\";\n"
|
||||
"template <> constexpr char x<int>[] = \"\";\n"));
|
||||
|
||||
// #10951
|
||||
ASSERT_NO_THROW(tokenizeAndStringify("struct a {\n"
|
||||
" template <class> static void b() {}\n"
|
||||
" ~a();\n"
|
||||
"};\n"
|
||||
"void d() { a::b<int>(); }\n"));
|
||||
}
|
||||
|
||||
void checkNamespaces() {
|
||||
|
|
Loading…
Reference in New Issue