summaryrefslogtreecommitdiffstats
path: root/test/expect/gccxml.any.Class-implicit-member-bad-base.xml.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-12-08 14:45:45 (GMT)
committerBrad King <brad.king@kitware.com>2014-12-08 14:55:31 (GMT)
commit01f991852c288a061e121e0c6017da32b34bb3da (patch)
tree464ec2a615c09ad439cf947b6ac2b3c82be6e87a /test/expect/gccxml.any.Class-implicit-member-bad-base.xml.txt
parent825cca7df68c0282339e3d0ec64e75f40fd57ed9 (diff)
downloadCastXML-01f991852c288a061e121e0c6017da32b34bb3da.zip
CastXML-01f991852c288a061e121e0c6017da32b34bb3da.tar.gz
CastXML-01f991852c288a061e121e0c6017da32b34bb3da.tar.bz2
RunClang: Refactor definition of implicit members
Use clang::Sema::PerformPendingInstantiations before we attempt to add implicit member definitions so any real errors show up first. Then set SuppressAllDiagnostics to suppress errors caused by the following. Iterate over all members of one class at a time in order of completion of class definition (bases before derived classes). Force definition of each member using clang::Sema::MarkFunctionReferenced followed by another call to clang::Sema::PerformPendingInstantiations to ensure that members formed by implicitly instantiated templates are completed. Clang will mark any failed declaration as invalid, allowing us to exclude it from the output. This works both for implicit and explicit members. Update the test suite to mark test cases that are no longer 'broken'. According to discussion on the Clang cfe-commits mailing list: [PATCH] Add DiagnosticSuppressionScope RAII class http://thread.gmane.org/gmane.comp.compilers.clang.scm/110832/focus=111112 this approach may depend on non-guaranteed behavior. By iterating over members in order of class definition, we mark any bad special members invalid in base classes so that when Clang processes those in derived classes the invalid members are only one "step" away. Hopefully this behavior will be easier to preserve if Clang changes in the future.
Diffstat (limited to 'test/expect/gccxml.any.Class-implicit-member-bad-base.xml.txt')
-rw-r--r--test/expect/gccxml.any.Class-implicit-member-bad-base.xml.txt26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/expect/gccxml.any.Class-implicit-member-bad-base.xml.txt b/test/expect/gccxml.any.Class-implicit-member-bad-base.xml.txt
new file mode 100644
index 0000000..3f73cac
--- /dev/null
+++ b/test/expect/gccxml.any.Class-implicit-member-bad-base.xml.txt
@@ -0,0 +1,26 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+ <Class id="_1" name="start" context="_2" location="f1:9" file="f1" line="9" members="_3 _4 _5" bases="_6">
+ <Base type="_6" access="public" virtual="0"/>
+ </Class>
+ <Constructor id="_3" name="start" context="_1" access="public" location="f1:9" file="f1" line="9" inline="1" artificial="1"( throws="")?/>
+ <Constructor id="_4" name="start" context="_1" access="public" location="f1:9" file="f1" line="9" inline="1" artificial="1"( throws="")?>
+ <Argument type="_7" location="f1:9" file="f1" line="9"/>
+ </Constructor>
+ <Destructor id="_5" name="start" context="_1" access="public" location="f1:9" file="f1" line="9" inline="1" artificial="1"( throws="")?/>
+ <Class id="_6" name="base&lt;const int&gt;" context="_2" location="f1:1" file="f1" line="1" members="_8 _9 _10 _11"/>
+ <ReferenceType id="_7" type="_1c"/>
+ <Field id="_8" name="data" type="_13" context="_6" access="protected" location="f1:3" file="f1" line="3"/>
+ <Constructor id="_9" name="base" context="_6" access="protected" location="f1:4" file="f1" line="4"/>
+ <Constructor id="_10" name="base" context="_6" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throws="")?>
+ <Argument type="_14" location="f1:1" file="f1" line="1"/>
+ </Constructor>
+ <Destructor id="_11" name="base" context="_6" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throws="")?/>
+ <CvQualifiedType id="_15c" type="_15" const="1"/>
+ <ReferenceType id="_14" type="_6c"/>
+ <FundamentalType id="_15" name="int"/>
+ <Namespace id="_2" name="::"/>
+ <CvQualifiedType id="_1c" type="_1" const="1"/>
+ <CvQualifiedType id="_6c" type="_6" const="1"/>
+ <File id="f1" name=".*/test/input/Class-implicit-member-bad-base.cxx"/>
+</GCC_XML>$