aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-07-21 20:43:11 +0000
committerTed Kremenek <kremenek@apple.com>2010-07-21 20:43:11 +0000
commit042411cc447f9b120086a6e4650583044f66fd12 (patch)
tree891249aee9e1eb7bb51b378f56e5dac07d8c5907 /test
parent04e6fd4a5ceded0a442a6b3e6b87057b9d643fe3 (diff)
Upgrade "'X' is unavailable" from a warning to an error. This matches GCC's behavior. Note that
GCC emits a warning instead of an error when using an unavailable Objective-C protocol, so now Clang's behavior is more strict in this case, but more consistent. We will need to see how much this fires on real code and determine whether this case should be downgraded to a warning. Fixes <rdar://problem/8213093>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109033 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/SemaCXX/attr-unavailable.cpp6
-rw-r--r--test/SemaObjC/protocol-attribute.m6
2 files changed, 6 insertions, 6 deletions
diff --git a/test/SemaCXX/attr-unavailable.cpp b/test/SemaCXX/attr-unavailable.cpp
index 8b381dfe4b..6f5aa5e78c 100644
--- a/test/SemaCXX/attr-unavailable.cpp
+++ b/test/SemaCXX/attr-unavailable.cpp
@@ -12,9 +12,9 @@ void test_foo(short* sp) {
double &dr = foo(1.0);
foo(sp); // expected-error{{call to unavailable function 'foo'}}
- void (*fp)(...) = &bar; // expected-warning{{'bar' is unavailable}}
- void (*fp2)(...) = bar; // expected-warning{{'bar' is unavailable}}
+ void (*fp)(...) = &bar; // expected-error{{'bar' is unavailable}}
+ void (*fp2)(...) = bar; // expected-error{{'bar' is unavailable}}
int &(*fp3)(int) = foo;
- void (*fp4)(...) = foo; // expected-warning{{'foo' is unavailable}}
+ void (*fp4)(...) = foo; // expected-error{{'foo' is unavailable}}
}
diff --git a/test/SemaObjC/protocol-attribute.m b/test/SemaObjC/protocol-attribute.m
index e04a39bda6..52c980396e 100644
--- a/test/SemaObjC/protocol-attribute.m
+++ b/test/SemaObjC/protocol-attribute.m
@@ -3,7 +3,7 @@
__attribute ((unavailable))
@protocol FwProto; // expected-note{{marked unavailable}}
-Class <FwProto> cFw = 0; // expected-warning {{'FwProto' is unavailable}}
+Class <FwProto> cFw = 0; // expected-error {{'FwProto' is unavailable}}
__attribute ((deprecated)) @protocol MyProto1
@@ -35,12 +35,12 @@ Class <MyProto1> clsP1 = 0; // expected-warning {{'MyProto1' is deprecated}}
@protocol FwProto @end // expected-note{{marked unavailable}}
-@interface MyClass2 <FwProto> // expected-warning {{'FwProto' is unavailable}}
+@interface MyClass2 <FwProto> // expected-error {{'FwProto' is unavailable}}
@end
__attribute ((unavailable)) __attribute ((deprecated)) @protocol XProto; // expected-note{{marked unavailable}}
-id <XProto> idX = 0; // expected-warning {{'XProto' is unavailable}} expected-warning {{'XProto' is deprecated}}
+id <XProto> idX = 0; // expected-error {{'XProto' is unavailable}} expected-warning {{'XProto' is deprecated}}
int main ()
{