Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++: accept prototypes starting from :: operator #3694

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--sort=no
--C++-kinds=+p
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bar input.cpp /^::std::string bar();$/;" p typeref:typename:::std::string file:
baz input.cpp /^::std::string baz() { return "not a prototype"; }$/;" f typeref:typename:::std::string
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Taken from #3693 submitted by @b4n
#include <string>

::std::string bar();
::std::string baz() { return "not a prototype"; }
3 changes: 2 additions & 1 deletion parsers/cxx/cxx_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,8 @@ void cxxParserAnalyzeOtherStatement(void)

CXXToken * t = cxxTokenChainFirst(g_cxx.pTokenChain);

if(!cxxTokenTypeIsOneOf(t,CXXTokenTypeIdentifier | CXXTokenTypeKeyword))
if(!cxxTokenTypeIsOneOf(t,CXXTokenTypeIdentifier | CXXTokenTypeKeyword
| CXXTokenTypeMultipleColons))
{
CXX_DEBUG_LEAVE_TEXT("Statement does not start with an identifier or keyword");
return;
Expand Down