Skip to content
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
6 changes: 6 additions & 0 deletions Units/parser-cxx.r/export-using.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--sort=no
--fields=+K
--kinds-C++=+MtNp
--fields-C++=+{properties}
--extras=+r
--fields=+r
5 changes: 5 additions & 0 deletions Units/parser-cxx.r/export-using.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Delta input.cpp /^export module Delta;$/;" module roles:def properties:export
Param input.cpp /^export using Param = int;$/;" typedef typeref:typename:int file: roles:def properties:export
Param input.cpp /^export using ::Param;$/;" name file: roles:def properties:export
Param input.cpp /^export using ::Param; \/\/ We can declare an object more than twice.$/;" name file: roles:def properties:export
fn input.cpp /^export void fn();$/;" prototype typeref:typename:void file: roles:def properties:export
7 changes: 7 additions & 0 deletions Units/parser-cxx.r/export-using.d/input.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Derived from https://github.com/universal-ctags/ctags/issues/4003 submitted by @adrianconstantin-leroy.
export module Delta;

export using Param = int;
export using ::Param;
export using ::Param; // We can declare an object more than twice.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to #1783

export void fn();
1 change: 1 addition & 0 deletions Units/parser-cxx.r/export-using.d/validator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cxx20+module
13 changes: 13 additions & 0 deletions parsers/cxx/cxx_parser_using.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ bool cxxParserParseUsingClause(void)
{
CXX_DEBUG_ENTER();

unsigned int uInitialKeywordState = g_cxx.uKeywordState;

// using-directives for namespaces and using-declarations
// for namespace members
// using-declarations for class members
Expand Down Expand Up @@ -170,7 +172,18 @@ bool cxxParserParseUsingClause(void)
{
tag->isFileScope = (cxxScopeGetType() == CXXScopeTypeNamespace) &&
(!isInputHeaderFile());

unsigned int uProperties = 0;
if(uInitialKeywordState & CXXParserKeywordStateSeenExport)
uProperties |= CXXTagPropertyExport;
vString * pszProperties = NULL;

if(uProperties)
pszProperties = cxxTagSetProperties(uProperties);

cxxTagCommit(NULL);

vStringDelete (pszProperties);
}
}
}
Expand Down