summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-05-15 18:44:29 (GMT)
committerBrad King <brad.king@kitware.com>2015-05-15 18:45:32 (GMT)
commit29edb122e53ee80201a7e535f6e26f161de86a47 (patch)
treeed52862f8c48dcd84f0c1f3bec4ffd3de3c72fe7 /test
parent40aed5c681c2355614d00b77f9eb372a77fa6a30 (diff)
downloadCastXML-29edb122e53ee80201a7e535f6e26f161de86a47.zip
CastXML-29edb122e53ee80201a7e535f6e26f161de86a47.tar.gz
CastXML-29edb122e53ee80201a7e535f6e26f161de86a47.tar.bz2
Output: Do not generate name="" attribute on anonymous namespaces
Be consistent with gccxml which did not generate the attribute.
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt1
-rw-r--r--test/expect/gccxml.any.Namespace-anonymous.xml.txt8
-rw-r--r--test/input/Namespace-anonymous.cxx5
3 files changed, 14 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 76ccf23..12f3fe5 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -188,6 +188,7 @@ castxml_test_gccxml(Method-rvalue-reference)
castxml_test_gccxml(MethodType)
castxml_test_gccxml(MethodType-cv)
castxml_test_gccxml(Namespace)
+castxml_test_gccxml(Namespace-anonymous)
castxml_test_gccxml(Namespace-Class-members)
castxml_test_gccxml(Namespace-Class-partial-template-members)
castxml_test_gccxml(Namespace-Class-template-members)
diff --git a/test/expect/gccxml.any.Namespace-anonymous.xml.txt b/test/expect/gccxml.any.Namespace-anonymous.xml.txt
new file mode 100644
index 0000000..12c2c4d
--- /dev/null
+++ b/test/expect/gccxml.any.Namespace-anonymous.xml.txt
@@ -0,0 +1,8 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+ <Namespace id="_1" name="start" context="_2" members="_3"/>
+ <Namespace id="_3" context="_1" members="_4"/>
+ <Struct id="_4" name="A" context="_3" location="f1:3" file="f1" line="3" incomplete="1"/>
+ <Namespace id="_2" name="::"/>
+ <File id="f1" name=".*/test/input/Namespace-anonymous.cxx"/>
+</GCC_XML>$
diff --git a/test/input/Namespace-anonymous.cxx b/test/input/Namespace-anonymous.cxx
new file mode 100644
index 0000000..f35a1ab
--- /dev/null
+++ b/test/input/Namespace-anonymous.cxx
@@ -0,0 +1,5 @@
+namespace start {
+ namespace {
+ struct A;
+ }
+}