From 507d13ede7410d33f1a63d00f690304acfb880a8 Mon Sep 17 00:00:00 2001 From: Thomas Kopp Date: Mon, 25 Apr 2022 13:48:33 +0200 Subject: [PATCH 1/2] CppParser: Support for return values in global ns If a return value of a member function is specified to be in the global namespace using leading double colons (e.g. ::MyClass) the parser is now recognizing it as valid c++ code instead of aborting with an exception. --- CppParser/src/Parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppParser/src/Parser.cpp b/CppParser/src/Parser.cpp index db4cc80df..3ce1aed13 100644 --- a/CppParser/src/Parser.cpp +++ b/CppParser/src/Parser.cpp @@ -379,7 +379,7 @@ const Token* Parser::parseClassMembers(const Token* pNext, Struct* /*pClass*/) poco_assert (isOperator(pNext, OperatorToken::OP_OPENBRACE)); pNext = next(); - while (pNext->is(Token::IDENTIFIER_TOKEN) || pNext->is(Token::KEYWORD_TOKEN) || isOperator(pNext, OperatorToken::OP_COMPL)) + while (pNext->is(Token::IDENTIFIER_TOKEN) || pNext->is(Token::KEYWORD_TOKEN) || isOperator(pNext, OperatorToken::OP_COMPL) || isOperator(pNext, OperatorToken::OP_DBL_COLON)) { switch (pNext->asInteger()) { From 20b201dd7df2bad64a28917dd9bc3b80b0e2aa8a Mon Sep 17 00:00:00 2001 From: Thomas Kopp Date: Mon, 25 Apr 2022 13:49:03 +0200 Subject: [PATCH 2/2] CppParser: Support for return values in global ns If a return value of a virtual member function is specified to be in the global namespace using leading double colons (e.g. virtual ::MyClass*) the parser is now handling the virtual keyword correctly. Prior the function was not declared as virtual and the return value was named as virtual::MyClass* which led to completely missleading results. --- CppParser/src/Parser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/CppParser/src/Parser.cpp b/CppParser/src/Parser.cpp index 3ce1aed13..1da09fabd 100644 --- a/CppParser/src/Parser.cpp +++ b/CppParser/src/Parser.cpp @@ -133,6 +133,7 @@ inline void Parser::append(std::string& decl, const std::string& token) || token == "static" || token == "mutable" || token == "inline" + || token == "virtual" || token == "volatile" || token == "register" || token == "thread_local")