summaryrefslogtreecommitdiff
path: root/test/SemaObjC/arc-repeated-weak.mm
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/arc-repeated-weak.mm')
-rw-r--r--test/SemaObjC/arc-repeated-weak.mm19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/SemaObjC/arc-repeated-weak.mm b/test/SemaObjC/arc-repeated-weak.mm
index d153eb9a52eb7..6c7a6292f992c 100644
--- a/test/SemaObjC/arc-repeated-weak.mm
+++ b/test/SemaObjC/arc-repeated-weak.mm
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime-has-weak -fobjc-arc -fblocks -Wno-objc-root-class -std=c++11 -Warc-repeated-use-of-weak -verify %s
-// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime-has-weak -fobjc-weak -fblocks -Wno-objc-root-class -std=c++11 -Warc-repeated-use-of-weak -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime-has-weak -fobjc-arc -fblocks -Wno-objc-root-class -std=c++14 -Warc-repeated-use-of-weak -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime-has-weak -fobjc-weak -fblocks -Wno-objc-root-class -std=c++14 -Warc-repeated-use-of-weak -verify %s
@interface Test {
@public
@@ -462,6 +462,21 @@ void foo() {
NSString * t2 = NSBundle.foo2.prop;
use(NSBundle.foo2.weakProp); // expected-warning{{weak property 'weakProp' may be accessed multiple times}}
use(NSBundle2.foo2.weakProp); // expected-note{{also accessed here}}
+ decltype([NSBundle2.foo2 weakProp]) t3;
+ decltype(NSBundle2.foo2.weakProp) t4;
+ __typeof__(NSBundle2.foo2.weakProp) t5;
+}
+
+void testAuto() {
+ auto __weak wp = NSBundle2.foo2.weakProp;
+}
+
+void testLambdaCaptureInit() {
+ [capture(NSBundle2.foo2.weakProp)] {} ();
+}
+
+void testAutoNew() {
+ auto p = new auto(NSBundle2.foo2.weakProp);
}
// This used to crash in the constructor of WeakObjectProfileTy when a