CppParser: fix for std::function<void()> parameter

The parameter was previously seen as a function because of it's
brackets.
This commit is contained in:
Fabio Oberhofer
2023-05-08 15:20:19 +02:00
parent ead93baadf
commit f6e2524db6
2 changed files with 39 additions and 0 deletions

View File

@@ -77,6 +77,22 @@ void CppParserTest::testExtractName()
decl = "void func(int arg1, int arg2)";
name = Symbol::extractName(decl);
assertTrue (name == "func");
decl = "std::function<bool> func";
name = Symbol::extractName(decl);
assertTrue (name == "func");
decl = "std::function<void(bool)> func";
name = Symbol::extractName(decl);
assertTrue (name == "func");
decl = "std::function<std::vector<int>(std::vector<bool>)> func";
name = Symbol::extractName(decl);
assertTrue (name == "func");
decl = "std::function<void*(std::function<const int*(void)>)> func";
name = Symbol::extractName(decl);
assertTrue (name == "func");
decl = "const std::vector<NS::MyType>* var";
name = Symbol::extractName(decl);