summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-03-06 19:21:09 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-24 15:37:20 (GMT)
commit5587f403b1555fa71ea88130852eb6e84df50368 (patch)
treee53ff7a452f68490c6549205d6e19229267a5ae6
parentedeba50dd3c12bae48a2b7b5d059184df54b8a62 (diff)
downloadCastXML-5587f403b1555fa71ea88130852eb6e84df50368.zip
CastXML-5587f403b1555fa71ea88130852eb6e84df50368.tar.gz
CastXML-5587f403b1555fa71ea88130852eb6e84df50368.tar.bz2
test: Add case for using declaration in derived class
Cover a class that brings overloads from a base through a using declaration.
-rw-r--r--test/CMakeLists.txt1
-rw-r--r--test/expect/gccxml.using-declaration-class-xml.txt39
-rw-r--r--test/input/using-declaration-class.cxx8
3 files changed, 48 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 6d04fcf..42abd2c 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -103,6 +103,7 @@ castxml_test_gccxml(Variable-in-Class)
castxml_test_gccxml(Variable-init)
castxml_test_gccxml(qualified-type-name)
+castxml_test_gccxml(using-declaration-class)
castxml_test_gccxml(using-declaration-ns)
castxml_test_gccxml(using-declaration-start)
castxml_test_gccxml(using-directive-ns)
diff --git a/test/expect/gccxml.using-declaration-class-xml.txt b/test/expect/gccxml.using-declaration-class-xml.txt
new file mode 100644
index 0000000..08d4188
--- /dev/null
+++ b/test/expect/gccxml.using-declaration-class-xml.txt
@@ -0,0 +1,39 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+ <Class id="_1" name="start" context="_2" location="f1:5" file="f1" line="5" members="_3 _4 _5 _6 _7 _8">
+ <Base type="_9" access="public" virtual="0"/>
+ </Class>
+ <Method id="_3" name="f" returns="_10" context="_9" access="protected" location="f1:3" file="f1" line="3">
+ <Argument type="_10" location="f1:3" file="f1" line="3"/>
+ </Method>
+ <Method id="_4" name="f" returns="_10" context="_1" access="private" location="f1:7" file="f1" line="7">
+ <Argument type="_11" location="f1:7" file="f1" line="7"/>
+ </Method>
+ <Constructor id="_5" name="start" context="_1" access="public" location="f1:5" file="f1" line="5" inline="1" artificial="1"/>
+ <Constructor id="_6" name="start" context="_1" access="public" location="f1:5" file="f1" line="5" inline="1" artificial="1">
+ <Argument type="_12" location="f1:5" file="f1" line="5"/>
+ </Constructor>
+ <OperatorMethod id="_7" name="=" returns="_13" context="_1" access="public" location="f1:5" file="f1" line="5" inline="1" artificial="1">
+ <Argument type="_12" location="f1:5" file="f1" line="5"/>
+ </OperatorMethod>
+ <Destructor id="_8" name="start" context="_1" access="public" location="f1:5" file="f1" line="5" inline="1" artificial="1"/>
+ <Class id="_9" name="base" context="_2" location="f1:1" file="f1" line="1" members="_3 _14 _15 _16 _17"/>
+ <FundamentalType id="_10" name="int"/>
+ <FundamentalType id="_11" name="char"/>
+ <ReferenceType id="_12" type="_1c"/>
+ <ReferenceType id="_13" type="_1"/>
+ <Constructor id="_14" name="base" context="_9" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"/>
+ <Constructor id="_15" name="base" context="_9" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1">
+ <Argument type="_19" location="f1:1" file="f1" line="1"/>
+ </Constructor>
+ <OperatorMethod id="_16" name="=" returns="_20" context="_9" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1">
+ <Argument type="_19" location="f1:1" file="f1" line="1"/>
+ </OperatorMethod>
+ <Destructor id="_17" name="base" context="_9" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"/>
+ <ReferenceType id="_19" type="_9c"/>
+ <ReferenceType id="_20" type="_9"/>
+ <Namespace id="_2" name="::"/>
+ <CvQualifiedType id="_9c" type="_9" const="1"/>
+ <CvQualifiedType id="_1c" type="_1" const="1"/>
+ <File id="f1" name=".*/test/input/using-declaration-class.cxx"/>
+</GCC_XML>$
diff --git a/test/input/using-declaration-class.cxx b/test/input/using-declaration-class.cxx
new file mode 100644
index 0000000..7b5ad6b
--- /dev/null
+++ b/test/input/using-declaration-class.cxx
@@ -0,0 +1,8 @@
+class base {
+protected:
+ int f(int);
+};
+class start: public base {
+ using base::f;
+ int f(char);
+};