Skip to content

Commit

Permalink
Merge pull request #424 from tristan0x/using-in-ns
Browse files Browse the repository at this point in the history
Remove spurious "typedef" in type declaration when using "using"
  • Loading branch information
vermeeren committed Mar 15, 2019
2 parents b23f4d7 + cc037a2 commit 94c1d98
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions breathe/renderer/sphinxrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,10 @@ def visit_typedef(self, node):
declaration = declaration[len(typedef):]
elif declaration.startswith(using):
declaration = declaration[len(using):]
# remove the spurious "typedef " on right hand side added
# by Doxygen observed when type is declared inside a namespace
# See examples/specific/using_in_ns
declaration = declaration.replace(" = typedef ", " = ")
obj_type = "using"

def update_signature(signature, obj_type):
Expand Down
11 changes: 11 additions & 0 deletions examples/specific/using_in_ns.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
PROJECT_NAME = "UsingInNS"
OUTPUT_DIRECTORY = using_in_ns
GENERATE_LATEX = NO
GENERATE_MAN = NO
GENERATE_RTF = NO
CASE_SENSE_NAMES = NO
INPUT = using_in_ns.h
QUIET = YES
JAVADOC_AUTOBRIEF = YES
GENERATE_HTML = NO
GENERATE_XML = YES
13 changes: 13 additions & 0 deletions examples/specific/using_in_ns.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// When declaring a type using a "using" directive inside a namespace,
// Doxygen adds a spurious "typedef" in the corresponding XML definition
//
// $ doxygen --version
// 1.8.11
//

namespace foo {
using foo_int = int; // <definition>using foo::foo_int = typedef int</definition>
}

using global_int = int; // <definition>using global_int = int</definition>

0 comments on commit 94c1d98

Please sign in to comment.