From e2debac88287ec608dd0651e1cc68cbbfdeda756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 29 Nov 2020 08:46:42 +0100 Subject: [PATCH] Fix testcases --- lib/tokenize.cpp | 2 +- test/testsimplifytemplate.cpp | 4 ++-- test/testsimplifytypedef.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index cbeb8aaa8..d64dc87fe 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -5159,7 +5159,7 @@ void Tokenizer::removeExtraTemplateKeywords() { if (isCPP()) { for (Token *tok = list.front(); tok; tok = tok->next()) { - if (Token::Match(tok, "%name% .|:: template %name%")) + if (Token::Match(tok, "%name%|> .|:: template %name%")) tok->next()->deleteNext(); } } diff --git a/test/testsimplifytemplate.cpp b/test/testsimplifytemplate.cpp index d84dd6275..ec51a3bb6 100644 --- a/test/testsimplifytemplate.cpp +++ b/test/testsimplifytemplate.cpp @@ -3371,8 +3371,8 @@ private: "template < bool b , class > using c = typename a < b > :: d ; " "template < class , template < class > class , class > struct e ; " "template < class f , class g , class ... h > " - "using i = typename e < f , g :: template fn , h ... > :: d ; " - "template < class ... j > struct k : c < sizeof... ( j ) , int > :: template fn < j ... > { } ;"; + "using i = typename e < f , g :: fn , h ... > :: d ; " + "template < class ... j > struct k : c < sizeof... ( j ) , int > :: fn < j ... > { } ;"; ASSERT_EQUALS(exp, tok(code)); } diff --git a/test/testsimplifytypedef.cpp b/test/testsimplifytypedef.cpp index 79f19253a..405ced7e3 100644 --- a/test/testsimplifytypedef.cpp +++ b/test/testsimplifytypedef.cpp @@ -2353,7 +2353,7 @@ private: "typename TrafoConfig > " "class AsmTraits1 { " "enum Anonymous0 { " - "domain_dim = SpaceType :: TrafoType :: template Evaluator < SpaceType :: TrafoType :: ShapeType , DataType > :: Type :: domain_dim , " + "domain_dim = SpaceType :: TrafoType :: Evaluator < SpaceType :: TrafoType :: ShapeType , DataType > :: Type :: domain_dim , " "} ; } ;"; ASSERT_EQUALS(expected, tok(code)); ASSERT_EQUALS("", errout.str());