summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-04-06 18:20:53 +0000
committerJohn McCall <rjmccall@apple.com>2012-04-06 18:20:53 +0000
commited7b27830d75b611c324307f21f1fe52f3f871de (patch)
tree48957acd148d857a93fec4e4c938305070d4fd65 /clang/test
parent0e09facb85683f1004367cb11a90fc85f4a5c289 (diff)
downloadbcm5719-llvm-ed7b27830d75b611c324307f21f1fe52f3f871de.tar.gz
bcm5719-llvm-ed7b27830d75b611c324307f21f1fe52f3f871de.zip
Fix a Sema invariant bug that I recently introduced involving
the template instantiation of statement-expressions. I think it was jyasskin who had a crashing testcase in this area; hopefully this fixes it and he can find his testcase and check it in. llvm-svn: 154189
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenObjCXX/arc.mm11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjCXX/arc.mm b/clang/test/CodeGenObjCXX/arc.mm
index 7b7429085fb..45211a2c19a 100644
--- a/clang/test/CodeGenObjCXX/arc.mm
+++ b/clang/test/CodeGenObjCXX/arc.mm
@@ -241,3 +241,14 @@ Test37 *instantiate_init() {
// CHECK: call i8* @objc_autoreleaseReturnValue
template Test37* instantiate_init<int>();
+// Just make sure that the AST invariants hold properly here,
+// i.e. that we don't crash.
+// The block should get bound in the full-expression outside
+// the statement-expression.
+template <class T> class Test38 {
+ void test(T x) {
+ ^{ (void) x; }, ({ x; });
+ }
+};
+// CHECK: define weak_odr void @_ZN6Test38IiE4testEi(
+template class Test38<int>;
OpenPOWER on IntegriCloud