summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-03-31 14:58:45 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-31 14:58:45 (GMT)
commit7b6294eef526429d1124acbdc258e09c8be217a3 (patch)
tree4a34e954fb21d5353dac261ee3fd21ff809a12f2 /test
parente2e8a196b04868ebaa739af1f1bffbd907e78ada (diff)
downloadCastXML-7b6294eef526429d1124acbdc258e09c8be217a3.zip
CastXML-7b6294eef526429d1124acbdc258e09c8be217a3.tar.gz
CastXML-7b6294eef526429d1124acbdc258e09c8be217a3.tar.bz2
Output: Skip friend function templates
The gccxml output format does not support uninstantiated templates so we need to skip friend declarations referencing them.
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt1
-rw-r--r--test/expect/gccxml.Class-template-friends-xml.txt22
-rw-r--r--test/input/Class-template-friends.cxx8
3 files changed, 31 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index fd35886..158215a 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -104,6 +104,7 @@ castxml_test_gccxml(Class-member-template)
castxml_test_gccxml(Class-template)
castxml_test_gccxml(Class-template-Method-Argument-default)
castxml_test_gccxml(Class-template-bases)
+castxml_test_gccxml(Class-template-friends)
castxml_test_gccxml(Class-template-member-Typedef)
castxml_test_gccxml(Class-template-member-template)
castxml_test_gccxml(CvQualifiedType)
diff --git a/test/expect/gccxml.Class-template-friends-xml.txt b/test/expect/gccxml.Class-template-friends-xml.txt
new file mode 100644
index 0000000..8bcd543
--- /dev/null
+++ b/test/expect/gccxml.Class-template-friends-xml.txt
@@ -0,0 +1,22 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+ <Class id="_1" name="start&lt;int&gt;" context="_2" location="f1:8" file="f1" line="8" members="_3 _4 _5 _6" befriending="_7 _8"/>
+ <Constructor id="_3" name="start" context="_1" access="public" location="f1:8" file="f1" line="8" inline="1" artificial="1"/>
+ <Constructor id="_4" name="start" context="_1" access="public" location="f1:8" file="f1" line="8" inline="1" artificial="1">
+ <Argument type="_9" location="f1:8" file="f1" line="8"/>
+ </Constructor>
+ <OperatorMethod id="_5" name="=" returns="_10" context="_1" access="public" location="f1:8" file="f1" line="8" inline="1" artificial="1">
+ <Argument type="_9" location="f1:8" file="f1" line="8"/>
+ </OperatorMethod>
+ <Destructor id="_6" name="start" context="_1" access="public" location="f1:8" file="f1" line="8" inline="1" artificial="1"/>
+ <ReferenceType id="_9" type="_1c"/>
+ <ReferenceType id="_10" type="_1"/>
+ <Namespace id="_2" name="::"/>
+ <Class id="_8" name="A&lt;int&gt;" context="_2" location="f1:1" file="f1" line="1" incomplete="1"/>
+ <Function id="_7" name="f" returns="_12" context="_2" location="f1:5" file="f1" line="5">
+ <Argument type="_12" location="f1:2" file="f1" line="2"/>
+ </Function>
+ <CvQualifiedType id="_1c" type="_1" const="1"/>
+ <FundamentalType id="_12" name="int"/>
+ <File id="f1" name=".*/test/input/Class-template-friends.cxx"/>
+</GCC_XML>$
diff --git a/test/input/Class-template-friends.cxx b/test/input/Class-template-friends.cxx
new file mode 100644
index 0000000..e1b3166
--- /dev/null
+++ b/test/input/Class-template-friends.cxx
@@ -0,0 +1,8 @@
+template <typename T> class A;
+template <typename T> int f(T);
+template <typename T> class start {
+ friend class A<T>;
+ friend int f<T>(T);
+ template <typename U> friend int f(U);
+};
+template class start<int>;