Fixed handling of pointers to functions in namespace as template parameters (#4172)
This commit is contained in:
parent
9cb9388e49
commit
e44ee280bc
|
@ -188,7 +188,7 @@ unsigned int TemplateSimplifier::templateParameters(const Token *tok)
|
|||
tok = tok->next();
|
||||
|
||||
// Skip '&'
|
||||
if (Token::Match(tok, "& %var% [,>]"))
|
||||
if (Token::Match(tok, "& ::| %var%"))
|
||||
tok = tok->next();
|
||||
|
||||
// skip std::
|
||||
|
|
|
@ -260,6 +260,7 @@ private:
|
|||
TEST_CASE(varid_catch);
|
||||
TEST_CASE(varid_functionPrototypeTemplate);
|
||||
TEST_CASE(varid_templatePtr); // #4319
|
||||
TEST_CASE(varid_templateNamespaceFuncPtr); // #4172
|
||||
|
||||
TEST_CASE(varidclass1);
|
||||
TEST_CASE(varidclass2);
|
||||
|
@ -4063,6 +4064,11 @@ private:
|
|||
"1: std :: map < int , FooTemplate < int > * > dummy_member@1 [ 1 ] ;\n", tokenizeDebugListing("std::map<int, FooTemplate<int>*> dummy_member[1];"));
|
||||
}
|
||||
|
||||
void varid_templateNamespaceFuncPtr() {
|
||||
ASSERT_EQUALS("\n\n##file 0\n"
|
||||
"1: KeyListT < float , & NIFFile :: getFloat > mKeyList@1 [ 4 ] ;\n", tokenizeDebugListing("KeyListT<float, &NIFFile::getFloat> mKeyList[4];"));
|
||||
}
|
||||
|
||||
void varidclass1() {
|
||||
const std::string actual = tokenizeDebugListing(
|
||||
"class Fred\n"
|
||||
|
|
Loading…
Reference in New Issue