Ticket #6181: Properly handle >> terminating template parameter lists.
This commit is contained in:
parent
6b78ae7c46
commit
4c7a8c5497
|
@ -1315,6 +1315,8 @@ bool TemplateSimplifier::simplifyTemplateInstantiations(
|
|||
++indentlevel5;
|
||||
else if (indentlevel5 > 0 && Token::Match(tok5, "> [,>]"))
|
||||
--indentlevel5;
|
||||
else if (indentlevel5 > 0 && tok5->str() == ">>")
|
||||
indentlevel5 -= 2;
|
||||
else if (indentlevel5 == 0) {
|
||||
if (tok5->str() != ",") {
|
||||
if (!typetok ||
|
||||
|
|
|
@ -338,6 +338,7 @@ private:
|
|||
TEST_CASE(cpp0xtemplate1);
|
||||
TEST_CASE(cpp0xtemplate2);
|
||||
TEST_CASE(cpp0xtemplate3);
|
||||
TEST_CASE(cpp0xtemplate4); // Ticket #6181: Mishandled C++11 syntax
|
||||
|
||||
TEST_CASE(arraySize);
|
||||
|
||||
|
@ -826,7 +827,7 @@ private:
|
|||
"void z() {\n"
|
||||
" vector<int> VI;\n"
|
||||
"}\n";
|
||||
ASSERT_THROW(tokenizeAndStringify(code, true), InternalError);
|
||||
tokenizeAndStringify(code, true);
|
||||
}
|
||||
|
||||
void tokenize34() { // #6121
|
||||
|
@ -5207,6 +5208,13 @@ private:
|
|||
tokenizeAndStringify(code));
|
||||
}
|
||||
|
||||
void cpp0xtemplate4() { // #6181
|
||||
tokenizeAndStringify("class A; "
|
||||
"template <class T> class Disposer; "
|
||||
"template <typename T, class D = Disposer<T>> class Shim {}; "
|
||||
"class B : public Shim<A> {};");
|
||||
}
|
||||
|
||||
std::string arraySize_(const std::string &code) {
|
||||
errout.str("");
|
||||
Settings settings;
|
||||
|
|
Loading…
Reference in New Issue