diff --git a/breathe/renderer/sphinxrenderer.py b/breathe/renderer/sphinxrenderer.py index 9ac22d5e..5bc64b43 100644 --- a/breathe/renderer/sphinxrenderer.py +++ b/breathe/renderer/sphinxrenderer.py @@ -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): diff --git a/examples/specific/using_in_ns.cfg b/examples/specific/using_in_ns.cfg new file mode 100644 index 00000000..1fca15d1 --- /dev/null +++ b/examples/specific/using_in_ns.cfg @@ -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 diff --git a/examples/specific/using_in_ns.h b/examples/specific/using_in_ns.h new file mode 100644 index 00000000..f19e6c44 --- /dev/null +++ b/examples/specific/using_in_ns.h @@ -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; // using foo::foo_int = typedef int +} + +using global_int = int; // using global_int = int