summaryrefslogtreecommitdiffstats
path: root/test/input
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-12-11 21:29:15 (GMT)
committerBrad King <brad.king@kitware.com>2015-12-14 16:44:22 (GMT)
commitf57109f31b94d0410e091a549a4aa0febc4140d6 (patch)
treee808c200077843a17e1873791cd3e9ac1f88beff /test/input
parentd10ec2e51efcff37b655404dd755e34b5e122cb1 (diff)
downloadCastXML-f57109f31b94d0410e091a549a4aa0febc4140d6.zip
CastXML-f57109f31b94d0410e091a549a4aa0febc4140d6.tar.gz
CastXML-f57109f31b94d0410e091a549a4aa0febc4140d6.tar.bz2
Output: Fix references to types whose declaration is invalid
We skip generating declarations that Clang has deemed invalid. Most callers of AddDeclDumpNode can check the return value and handle the lack of a valid decl. However, callers of AddDeclDumpNodeForType are generating references to types and expect to get a valid element to reference. We can get an invalid RecordDecl when it is a template instantation that fails (but does not otherwise produce a compilation error in Clang). References to types corresponding to the invalid RecordDecl must remain valid, so generate a Class/Struct/Union element anyway and simply leave out class members and bases.
Diffstat (limited to 'test/input')
-rw-r--r--test/input/invalid-decl-for-type.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/input/invalid-decl-for-type.cxx b/test/input/invalid-decl-for-type.cxx
new file mode 100644
index 0000000..5c2225f
--- /dev/null
+++ b/test/input/invalid-decl-for-type.cxx
@@ -0,0 +1,7 @@
+template<typename T> struct A { T x; };
+template<typename T> struct B { B() { A<T> a; } };
+struct Incomplete;
+struct start {
+ B<Incomplete> b;
+ typedef A<Incomplete> type;
+};