diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-07-21 20:43:11 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-07-21 20:43:11 +0000 |
commit | 1ddd6d2b6b804e8036e60cfa500b31cce1373bc9 (patch) | |
tree | 4454fe5189b68b411d049af48cf379df4e40fdfc /clang/test | |
parent | 19b3830142001b74e29ab5fa11ef76e87aaf7b1e (diff) | |
download | bcm5719-llvm-1ddd6d2b6b804e8036e60cfa500b31cce1373bc9.tar.gz bcm5719-llvm-1ddd6d2b6b804e8036e60cfa500b31cce1373bc9.zip |
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>.
llvm-svn: 109033
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/SemaCXX/attr-unavailable.cpp | 6 | ||||
-rw-r--r-- | clang/test/SemaObjC/protocol-attribute.m | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/clang/test/SemaCXX/attr-unavailable.cpp b/clang/test/SemaCXX/attr-unavailable.cpp index 8b381dfe4b2..6f5aa5e78c4 100644 --- a/clang/test/SemaCXX/attr-unavailable.cpp +++ b/clang/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/clang/test/SemaObjC/protocol-attribute.m b/clang/test/SemaObjC/protocol-attribute.m index e04a39bda6c..52c980396ed 100644 --- a/clang/test/SemaObjC/protocol-attribute.m +++ b/clang/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 () { |