diff --git a/Units/parser-cxx.r/prototype-starting-from-scope-op.d/args.ctags b/Units/parser-cxx.r/prototype-starting-from-scope-op.d/args.ctags new file mode 100644 index 0000000000..ff7404962f --- /dev/null +++ b/Units/parser-cxx.r/prototype-starting-from-scope-op.d/args.ctags @@ -0,0 +1,2 @@ +--sort=no +--C++-kinds=+p diff --git a/Units/parser-cxx.r/prototype-starting-from-scope-op.d/expected.tags b/Units/parser-cxx.r/prototype-starting-from-scope-op.d/expected.tags new file mode 100644 index 0000000000..14f112a94e --- /dev/null +++ b/Units/parser-cxx.r/prototype-starting-from-scope-op.d/expected.tags @@ -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 diff --git a/Units/parser-cxx.r/prototype-starting-from-scope-op.d/input.cpp b/Units/parser-cxx.r/prototype-starting-from-scope-op.d/input.cpp new file mode 100644 index 0000000000..04f82b71a8 --- /dev/null +++ b/Units/parser-cxx.r/prototype-starting-from-scope-op.d/input.cpp @@ -0,0 +1,5 @@ +// Taken from #3693 submitted by @b4n +#include + +::std::string bar(); +::std::string baz() { return "not a prototype"; } diff --git a/parsers/cxx/cxx_parser.c b/parsers/cxx/cxx_parser.c index 63256ba8a1..6ed9a83dd5 100644 --- a/parsers/cxx/cxx_parser.c +++ b/parsers/cxx/cxx_parser.c @@ -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;