[NFC] Add original test that triggered crash post r301735
authorFaisal Vali <faisalv@yahoo.com>
Tue, 2 May 2017 21:02:46 +0000 (21:02 +0000)
committerFaisal Vali <faisalv@yahoo.com>
Tue, 2 May 2017 21:02:46 +0000 (21:02 +0000)
- this is added just for completeness sake (though the general case should be represented by the test added in the revision to that patch:  https://reviews.llvm.org/rL301972 )

llvm-svn: 301973

clang/test/SemaCXX/warn-thread-safety-parsing.cpp

index b43e24a..ae32bfe 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -fsyntax-only -verify -Wthread-safety %s
 // RUN: %clang_cc1 -fsyntax-only -verify -Wthread-safety -std=c++98 %s
-// RUN: %clang_cc1 -fsyntax-only -verify -Wthread-safety -std=c++11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wthread-safety -std=c++11 %s -D CPP11
 
 #define LOCKABLE            __attribute__ ((lockable))
 #define SCOPED_LOCKABLE     __attribute__ ((scoped_lockable))
@@ -1513,3 +1513,15 @@ public:
 
 }  // end namespace FunctionAttributesInsideClass_ICE_Test
 
+
+#ifdef CPP11
+namespace CRASH_POST_R301735 {
+  class SomeClass {
+   public:
+     void foo() {
+       auto l = [this] { auto l = [] () EXCLUSIVE_LOCKS_REQUIRED(mu_) {}; };
+     }
+     Mutex mu_;
+   };
+}
+#endif
\ No newline at end of file