diff options
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.td | 3 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 2 | ||||
| -rw-r--r-- | clang/test/SemaCXX/attr-unavailable.cpp | 6 | ||||
| -rw-r--r-- | clang/test/SemaObjC/protocol-attribute.m | 6 |
4 files changed, 8 insertions, 9 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 24b326ae1f6..59bd8f8e384 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -1685,8 +1685,7 @@ def note_dependent_var_use : Note<"must qualify identifier to find this " def err_undeclared_use : Error<"use of undeclared %0">; def warn_deprecated : Warning<"%0 is deprecated">, InGroup<DeprecatedDeclarations>; -def warn_unavailable : Warning<"%0 is unavailable">, - InGroup<DeprecatedDeclarations>; +def err_unavailable : Error<"%0 is unavailable">; def note_unavailable_here : Note< "function has been explicitly marked %select{unavailable|deleted}0 here">; def warn_not_enough_argument : Warning< diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 73127df5ddc..58bc4f0801d 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -59,7 +59,7 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc) { // See if the decl is unavailable if (D->getAttr<UnavailableAttr>()) { - Diag(Loc, diag::warn_unavailable) << D->getDeclName(); + Diag(Loc, diag::err_unavailable) << D->getDeclName(); Diag(D->getLocation(), diag::note_unavailable_here) << 0; } 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 () { |

