summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-04-19 18:35:01 (GMT)
committerBrad King <brad.king@kitware.com>2016-04-19 18:56:03 (GMT)
commitc7de52912ca365accc004b01ba95a2bfebe14b0e (patch)
treeb0e08f94e719659962d993d65823f73977d4220c /test
parent919b87c0172b4e623feb6870983152f3be0b2748 (diff)
downloadCastXML-c7de52912ca365accc004b01ba95a2bfebe14b0e.zip
CastXML-c7de52912ca365accc004b01ba95a2bfebe14b0e.tar.gz
CastXML-c7de52912ca365accc004b01ba95a2bfebe14b0e.tar.bz2
Output: Fix access specifier of incomplete class template instantiations
In code like class foo { template <typename> class bar {}; typedef bar<char> incomplete; }; template class foo::bar<int>; // complete the instantiations of `foo::bar<>` should have the same access as the original template whether they are fully instantiated or incomplete. GitHub-Issue: CastXML/CastXML#56
Diffstat (limited to 'test')
-rw-r--r--test/expect/gccxml.any.Class-member-template-access.xml.txt40
-rw-r--r--test/input/Class-member-template-access.cxx2
2 files changed, 23 insertions, 19 deletions
diff --git a/test/expect/gccxml.any.Class-member-template-access.xml.txt b/test/expect/gccxml.any.Class-member-template-access.xml.txt
index e2c0cd7..4c2a0fc 100644
--- a/test/expect/gccxml.any.Class-member-template-access.xml.txt
+++ b/test/expect/gccxml.any.Class-member-template-access.xml.txt
@@ -1,29 +1,31 @@
^<\?xml version="1.0"\?>
<GCC_XML[^>]*>
- <Class id="_1" name="start" context="_2" location="f1:1" file="f1" line="1" members="_3 _4 _5 _6 _7" size="[0-9]+" align="[0-9]+"/>
- <Class id="_3" name="member&lt;int&gt;" context="_1" access="private" location="f1:4" file="f1" line="4" members="_8 _9 _10 _11" size="[0-9]+" align="[0-9]+"/>
- <Constructor id="_4" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
- <Constructor id="_5" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?>
- <Argument type="_12" location="f1:1" file="f1" line="1"/>
+ <Class id="_1" name="start" context="_2" location="f1:1" file="f1" line="1" members="_3 _4 _5 _6 _7 _8 _9" size="[0-9]+" align="[0-9]+"/>
+ <Class id="_3" name="member&lt;char&gt;" context="_1" access="private" location="f1:2" file="f1" line="2" incomplete="1"/>
+ <Class id="_4" name="member&lt;int&gt;" context="_1" access="private" location="f1:6" file="f1" line="6" members="_10 _11 _12 _13" size="[0-9]+" align="[0-9]+"/>
+ <Typedef id="_5" name="member_char" type="_3" context="_1" access="public" location="f1:4" file="f1" line="4"/>
+ <Constructor id="_6" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_7" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?>
+ <Argument type="_14" location="f1:1" file="f1" line="1"/>
</Constructor>
- <OperatorMethod id="_6" name="=" returns="_13" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")? mangled="[^"]+">
- <Argument type="_12" location="f1:1" file="f1" line="1"/>
+ <OperatorMethod id="_8" name="=" returns="_15" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+ <Argument type="_14" location="f1:1" file="f1" line="1"/>
</OperatorMethod>
- <Destructor id="_7" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
- <Constructor id="_8" name="member" context="_3" access="public" location="f1:4" file="f1" line="4" inline="1" artificial="1"( throw="")?/>
- <Constructor id="_9" name="member" context="_3" access="public" location="f1:4" file="f1" line="4" inline="1" artificial="1"( throw="")?>
- <Argument type="_14" location="f1:4" file="f1" line="4"/>
+ <Destructor id="_9" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_10" name="member" context="_4" access="public" location="f1:6" file="f1" line="6" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_11" name="member" context="_4" access="public" location="f1:6" file="f1" line="6" inline="1" artificial="1"( throw="")?>
+ <Argument type="_16" location="f1:6" file="f1" line="6"/>
</Constructor>
- <OperatorMethod id="_10" name="=" returns="_15" context="_3" access="public" location="f1:4" file="f1" line="4" inline="1" artificial="1"( throw="")? mangled="[^"]+">
- <Argument type="_14" location="f1:4" file="f1" line="4"/>
+ <OperatorMethod id="_12" name="=" returns="_17" context="_4" access="public" location="f1:6" file="f1" line="6" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+ <Argument type="_16" location="f1:6" file="f1" line="6"/>
</OperatorMethod>
- <Destructor id="_11" name="member" context="_3" access="public" location="f1:4" file="f1" line="4" inline="1" artificial="1"( throw="")?/>
- <ReferenceType id="_12" type="_1c"/>
+ <Destructor id="_13" name="member" context="_4" access="public" location="f1:6" file="f1" line="6" inline="1" artificial="1"( throw="")?/>
+ <ReferenceType id="_14" type="_1c"/>
<CvQualifiedType id="_1c" type="_1" const="1"/>
- <ReferenceType id="_13" type="_1"/>
- <ReferenceType id="_14" type="_3c"/>
- <CvQualifiedType id="_3c" type="_3" const="1"/>
- <ReferenceType id="_15" type="_3"/>
+ <ReferenceType id="_15" type="_1"/>
+ <ReferenceType id="_16" type="_4c"/>
+ <CvQualifiedType id="_4c" type="_4" const="1"/>
+ <ReferenceType id="_17" type="_4"/>
<Namespace id="_2" name="::"/>
<File id="f1" name=".*/test/input/Class-member-template-access.cxx"/>
</GCC_XML>$
diff --git a/test/input/Class-member-template-access.cxx b/test/input/Class-member-template-access.cxx
index d05fe4b..1bcead7 100644
--- a/test/input/Class-member-template-access.cxx
+++ b/test/input/Class-member-template-access.cxx
@@ -1,4 +1,6 @@
class start {
template <typename> class member {};
+public:
+ typedef member<char> member_char; // incomplete
};
template class start::member<int>; // instantiation