summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2015-10-28 05:03:19 +0000
committerJohn McCall <rjmccall@apple.com>2015-10-28 05:03:19 +0000
commitc6af8c606dae9a9b728d5099d5964ea6540dc22c (patch)
tree0a19128c0f58cc451454838159b232968eb359e5 /clang/test
parent9b1534df9da6695fde3d639e8ee3b9a7cf36b0a4 (diff)
downloadbcm5719-llvm-c6af8c606dae9a9b728d5099d5964ea6540dc22c.tar.gz
bcm5719-llvm-c6af8c606dae9a9b728d5099d5964ea6540dc22c.zip
Refine r251469 to give better (and more localizable) diagnostics
for all the reasons that ARC makes things implicitly unavailable. llvm-svn: 251496
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaObjC/arc-system-header.m30
-rw-r--r--clang/test/SemaObjC/arc-unavailable-system-function.m4
-rw-r--r--clang/test/SemaObjC/mrc-no-weak.m6
-rw-r--r--clang/test/SemaObjCXX/arc-system-header.mm4
4 files changed, 22 insertions, 22 deletions
diff --git a/clang/test/SemaObjC/arc-system-header.m b/clang/test/SemaObjC/arc-system-header.m
index a627b3be9bb..acfd9a8585e 100644
--- a/clang/test/SemaObjC/arc-system-header.m
+++ b/clang/test/SemaObjC/arc-system-header.m
@@ -5,26 +5,26 @@
#ifndef NO_USE
void test(id op, void *cp) {
- cp = test0(op); // expected-error {{'test0' is unavailable: converts between Objective-C and C pointers in -fobjc-arc}}
- cp = *test1(&op); // expected-error {{'test1' is unavailable: converts between Objective-C and C pointers in -fobjc-arc}}
-// expected-note@arc-system-header.h:1 {{'test0' has been explicitly marked unavailable here}}
-// expected-note@arc-system-header.h:5 {{'test1' has been explicitly marked unavailable here}}
+ cp = test0(op); // expected-error {{'test0' is unavailable in ARC}}
+ cp = *test1(&op); // expected-error {{'test1' is unavailable in ARC}}
+// expected-note@arc-system-header.h:1 {{inline function performs a conversion which is forbidden in ARC}}
+// expected-note@arc-system-header.h:5 {{inline function performs a conversion which is forbidden in ARC}}
}
void test3(struct Test3 *p) {
- p->field = 0; // expected-error {{'field' is unavailable: this system declaration uses an unsupported type}}
- // expected-note@arc-system-header.h:14 {{unsupported declaration here}}
+ p->field = 0; // expected-error {{'field' is unavailable in ARC}}
+ // expected-note@arc-system-header.h:14 {{declaration uses type that is ill-formed in ARC}}
}
void test4(Test4 *p) {
- p->field1 = 0; // expected-error {{'field1' is unavailable: this system declaration uses an unsupported type}}
- // expected-note@arc-system-header.h:19 {{unsupported declaration here}}
+ p->field1 = 0; // expected-error {{'field1' is unavailable in ARC}}
+ // expected-note@arc-system-header.h:19 {{declaration uses type that is ill-formed in ARC}}
p->field2 = 0;
}
void test5(struct Test5 *p) {
- p->field = 0; // expected-error {{'field' is unavailable: this system field has retaining ownership}}
- // expected-note@arc-system-header.h:25 {{'field' has been explicitly marked unavailable here}}
+ p->field = 0; // expected-error {{'field' is unavailable in ARC}}
+ // expected-note@arc-system-header.h:25 {{field has non-trivial ownership qualification}}
}
id test6() {
@@ -39,11 +39,11 @@ id test6() {
}
void test7(Test7 *p) {
- *p.prop = 0; // expected-error {{'prop' is unavailable: this system declaration uses an unsupported type}}
- p.prop = 0; // expected-error {{'prop' is unavailable: this system declaration uses an unsupported type}}
- *[p prop] = 0; // expected-error {{'prop' is unavailable: this system declaration uses an unsupported type}}
- [p setProp: 0]; // expected-error {{'setProp:' is unavailable: this system declaration uses an unsupported type}}
-// expected-note@arc-system-header.h:41 4 {{unsupported declaration here}}
+ *p.prop = 0; // expected-error {{'prop' is unavailable in ARC}}
+ p.prop = 0; // expected-error {{'prop' is unavailable in ARC}}
+ *[p prop] = 0; // expected-error {{'prop' is unavailable in ARC}}
+ [p setProp: 0]; // expected-error {{'setProp:' is unavailable in ARC}}
+// expected-note@arc-system-header.h:41 4 {{declaration uses type that is ill-formed in ARC}}
// expected-note@arc-system-header.h:41 2 {{property 'prop' is declared unavailable here}}
}
#endif
diff --git a/clang/test/SemaObjC/arc-unavailable-system-function.m b/clang/test/SemaObjC/arc-unavailable-system-function.m
index 72a8c97d0bb..e9e217980fb 100644
--- a/clang/test/SemaObjC/arc-unavailable-system-function.m
+++ b/clang/test/SemaObjC/arc-unavailable-system-function.m
@@ -3,11 +3,11 @@
# 1 "<command line>"
# 1 "/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h" 1 3
-id * foo(); // expected-note {{unsupported declaration here}}
+id * foo(); // expected-note {{declaration uses type that is ill-formed in ARC}}
# 1 "arc-unavailable-system-function.m" 2
void ret() {
- foo(); // expected-error {{'foo' is unavailable: this system declaration uses an unsupported type}}
+ foo(); // expected-error {{'foo' is unavailable in ARC}}
}
diff --git a/clang/test/SemaObjC/mrc-no-weak.m b/clang/test/SemaObjC/mrc-no-weak.m
index 2fe2d33d505..fcb17440641 100644
--- a/clang/test/SemaObjC/mrc-no-weak.m
+++ b/clang/test/SemaObjC/mrc-no-weak.m
@@ -36,13 +36,13 @@ __attribute__((objc_root_class))
@interface E : Root {
@public
- __weak id x; // expected-note 2 {{unsupported declaration here}}
+ __weak id x; // expected-note 2 {{declaration uses __weak, but ARC is disabled}}
}
@end
void testE(E *e) {
- id x = e->x; // expected-error {{'x' is unavailable: cannot use weak references in file using manual reference counting}}
- e->x = x; // expected-error {{'x' is unavailable: cannot use weak references in file using manual reference counting}}
+ id x = e->x; // expected-error {{'x' is unavailable}}
+ e->x = x; // expected-error {{'x' is unavailable}}
}
@interface F : Root
diff --git a/clang/test/SemaObjCXX/arc-system-header.mm b/clang/test/SemaObjCXX/arc-system-header.mm
index b97e2f3b1eb..5f5445c8956 100644
--- a/clang/test/SemaObjCXX/arc-system-header.mm
+++ b/clang/test/SemaObjCXX/arc-system-header.mm
@@ -4,6 +4,6 @@
void f(A* a) {
a->data.void_ptr = 0;
- a->data.a_b.b = 0; // expected-error{{'a_b' is unavailable: this system field has retaining ownership}}
+ a->data.a_b.b = 0; // expected-error{{'a_b' is unavailable in ARC}}
}
-// expected-note@arc-system-header.h:10{{'a_b' has been explicitly marked unavailable here}}
+// expected-note@arc-system-header.h:10{{field has non-trivial ownership qualification}}
OpenPOWER on IntegriCloud