parent
f6a2034a4c
commit
590aeea8f8
|
@ -246,7 +246,7 @@ void TemplateSimplifier::fixAngleBrackets()
|
||||||
}
|
}
|
||||||
} else if (Token::Match(tok, "class|struct|union|=|:|public|protected|private %name% <")) {
|
} else if (Token::Match(tok, "class|struct|union|=|:|public|protected|private %name% <")) {
|
||||||
Token *endTok = tok->tokAt(2)->findClosingBracket();
|
Token *endTok = tok->tokAt(2)->findClosingBracket();
|
||||||
if (Token::Match(endTok, ">> ;|{")) {
|
if (Token::Match(endTok, ">> ;|{|%type%")) {
|
||||||
endTok->str(">");
|
endTok->str(">");
|
||||||
endTok->insertToken(">");
|
endTok->insertToken(">");
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,6 +190,7 @@ private:
|
||||||
TEST_CASE(template150); // syntax error
|
TEST_CASE(template150); // syntax error
|
||||||
TEST_CASE(template151); // crash
|
TEST_CASE(template151); // crash
|
||||||
TEST_CASE(template152); // #9467
|
TEST_CASE(template152); // #9467
|
||||||
|
TEST_CASE(template153); // #9483
|
||||||
TEST_CASE(template_specialization_1); // #7868 - template specialization template <typename T> struct S<C<T>> {..};
|
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_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)
|
TEST_CASE(template_enum); // #6299 Syntax error in complex enum declaration (including template)
|
||||||
|
@ -3652,6 +3653,12 @@ private:
|
||||||
ASSERT_EQUALS(exp, tok(code));
|
ASSERT_EQUALS(exp, tok(code));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void template153() { // #9483
|
||||||
|
const char code[] = "template <class = b<decltype(a<h>())...>> void i();";
|
||||||
|
const char exp[] = "template < class = b < decltype ( a < h > ( ) ) ... > > void i ( ) ;";
|
||||||
|
ASSERT_EQUALS(exp, tok(code));
|
||||||
|
}
|
||||||
|
|
||||||
void template_specialization_1() { // #7868 - template specialization template <typename T> struct S<C<T>> {..};
|
void template_specialization_1() { // #7868 - template specialization template <typename T> struct S<C<T>> {..};
|
||||||
const char code[] = "template <typename T> struct C {};\n"
|
const char code[] = "template <typename T> struct C {};\n"
|
||||||
"template <typename T> struct S {a};\n"
|
"template <typename T> struct S {a};\n"
|
||||||
|
|
Loading…
Reference in New Issue