From 1b6c7e75a93ad4d44a1d1609c9a496f6979e0193 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 26 Feb 2014 16:48:14 -0500 Subject: Output: Generate Ellipsis element inside variadic functions and types --- src/Output.cxx | 6 ++++++ test/CMakeLists.txt | 2 ++ test/expect/gccxml.Function-variadic-xml.txt | 11 +++++++++++ test/expect/gccxml.FunctionType-variadic-xml.txt | 12 ++++++++++++ test/input/Function-variadic.cxx | 1 + test/input/FunctionType-variadic.cxx | 1 + 6 files changed, 33 insertions(+) create mode 100644 test/expect/gccxml.Function-variadic-xml.txt create mode 100644 test/expect/gccxml.FunctionType-variadic-xml.txt create mode 100644 test/input/Function-variadic.cxx create mode 100644 test/input/FunctionType-variadic.cxx diff --git a/src/Output.cxx b/src/Output.cxx index c93acfc..6133a77 100644 --- a/src/Output.cxx +++ b/src/Output.cxx @@ -838,6 +838,9 @@ void ASTVisitor::OutputFunctionHelper(clang::FunctionDecl const* d, e = d->param_end(); i != e; ++i) { this->OutputFunctionArgument(*i, dn->Complete); } + if(d->isVariadic()) { + this->OS << " \n"; + } this->OS << " \n"; } else { this->OS << "/>\n"; @@ -859,6 +862,9 @@ void ASTVisitor::OutputFunctionTypeHelper(clang::FunctionProtoType const* t, this->PrintTypeAttribute(*i, dn->Complete); this->OS << "/>\n"; } + if(t->isVariadic()) { + this->OS << " \n"; + } this->OS << " \n"; } else { this->OS << "/>\n"; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e6a69f1..66ec112 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -75,7 +75,9 @@ castxml_test_gccxml(Field) castxml_test_gccxml(Function) castxml_test_gccxml(Function-template) castxml_test_gccxml(Function-throw) +castxml_test_gccxml(Function-variadic) castxml_test_gccxml(FunctionType) +castxml_test_gccxml(FunctionType-variadic) castxml_test_gccxml(FundamentalType) castxml_test_gccxml(Method) castxml_test_gccxml(Namespace) diff --git a/test/expect/gccxml.Function-variadic-xml.txt b/test/expect/gccxml.Function-variadic-xml.txt new file mode 100644 index 0000000..cd75d0f --- /dev/null +++ b/test/expect/gccxml.Function-variadic-xml.txt @@ -0,0 +1,11 @@ +^<\?xml version="1.0"\?> +]*> + + + + + + + + +$ diff --git a/test/expect/gccxml.FunctionType-variadic-xml.txt b/test/expect/gccxml.FunctionType-variadic-xml.txt new file mode 100644 index 0000000..f13d334 --- /dev/null +++ b/test/expect/gccxml.FunctionType-variadic-xml.txt @@ -0,0 +1,12 @@ +^<\?xml version="1.0"\?> +]*> + + + + + + + + + +$ diff --git a/test/input/Function-variadic.cxx b/test/input/Function-variadic.cxx new file mode 100644 index 0000000..2a2510b --- /dev/null +++ b/test/input/Function-variadic.cxx @@ -0,0 +1 @@ +void start(int,...); diff --git a/test/input/FunctionType-variadic.cxx b/test/input/FunctionType-variadic.cxx new file mode 100644 index 0000000..90b9294 --- /dev/null +++ b/test/input/FunctionType-variadic.cxx @@ -0,0 +1 @@ +typedef void start(int,...); -- cgit v0.12