summaryrefslogtreecommitdiffstats
path: root/test/input/Class-implicit-member-reference.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-03-20 16:54:55 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-24 18:18:54 (GMT)
commit3bb8bd6662baf02caa6618fc271b5daaebfbab63 (patch)
tree34a4aafe84d38e17023937b913aee43ffefc3734 /test/input/Class-implicit-member-reference.cxx
parent25ff73764f1a54a0c3689df949f2d7e9ab41a014 (diff)
downloadCastXML-3bb8bd6662baf02caa6618fc271b5daaebfbab63.zip
CastXML-3bb8bd6662baf02caa6618fc271b5daaebfbab63.tar.gz
CastXML-3bb8bd6662baf02caa6618fc271b5daaebfbab63.tar.bz2
Output: Skip implicit members that cannot be compiled
Implement the HandleTagDeclDefinition method in our ASTConsumer. Clang calls this method during parsing on completion of each class definition. This gives us a chance to modify class definitions. Teach HandleTagDeclDefinition to add the implicit member declarations. For each implicit member, ask Clang to try instantiating its definition to see if a call to the member will actually work. Suppress errors during this check using a clang::Sema::SFINAETrap and simply mark the declaration as invalid if there were errors. Add test cases for: * implicit members that cannot be used due to access, const data members, or reference data members. * a POD array data member since Clang uses special logic when creating implicit members that copy the data. * a mutable data member since Clang adds implicit member declarations itself (via clang::Sema::AddImplicitlyDeclaredMembersToClass), but we still need to try defining them. * a class that uses its implicit members so they are already defined.
Diffstat (limited to 'test/input/Class-implicit-member-reference.cxx')
-rw-r--r--test/input/Class-implicit-member-reference.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/input/Class-implicit-member-reference.cxx b/test/input/Class-implicit-member-reference.cxx
new file mode 100644
index 0000000..67da21d
--- /dev/null
+++ b/test/input/Class-implicit-member-reference.cxx
@@ -0,0 +1,5 @@
+class start {
+ int& ref;
+public:
+ start();
+};