parent
92ab7c6b92
commit
59fdbd8435
|
@ -366,7 +366,7 @@ void TemplateSimplifier::checkComplicatedSyntaxErrorsInTemplates()
|
|||
;
|
||||
else if (level == 0 && Token::Match(tok2->previous(), "%type%")) {
|
||||
// @todo add better expression detection
|
||||
if (!Token::Match(tok2->next(), "%type%|%num% ;"))
|
||||
if (!Token::Match(tok2->next(), "*| %type%|%num% ;"))
|
||||
inclevel = true;
|
||||
} else if (tok2->next() && tok2->next()->isStandardType())
|
||||
inclevel = true;
|
||||
|
|
|
@ -178,6 +178,7 @@ private:
|
|||
TEST_CASE(template138);
|
||||
TEST_CASE(template139);
|
||||
TEST_CASE(template140);
|
||||
TEST_CASE(template141); // #9337
|
||||
TEST_CASE(template_specialization_1); // #7868 - template specialization template <typename T> struct S<C<T>> {..};
|
||||
TEST_CASE(template_specialization_2); // #7868 - template specialization template <typename T> struct S<C<T>> {..};
|
||||
TEST_CASE(template_enum); // #6299 Syntax error in complex enum declaration (including template)
|
||||
|
@ -3428,6 +3429,18 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
void template141() { // #9337
|
||||
const char code[] = "struct a {\n"
|
||||
" int c;\n"
|
||||
" template <typename b> void d(b e) const { c < *e; }\n"
|
||||
"};";
|
||||
const char exp[] = "struct a { "
|
||||
"int c ; "
|
||||
"template < typename b > void d ( b e ) const { c < * e ; } "
|
||||
"} ;";
|
||||
ASSERT_EQUALS(exp, tok(code));
|
||||
}
|
||||
|
||||
void template_specialization_1() { // #7868 - template specialization template <typename T> struct S<C<T>> {..};
|
||||
const char code[] = "template <typename T> struct C {};\n"
|
||||
"template <typename T> struct S {a};\n"
|
||||
|
|
Loading…
Reference in New Issue