From: Douglas Gregor Date: Mon, 28 Jan 2013 20:13:44 +0000 (+0000) Subject: Undo my re-wording of the "ARC forbids Objective-C objects in ..." X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bde67cfdf05f7c569661e7a490b0b0811ac1ec56;p=clang Undo my re-wording of the "ARC forbids Objective-C objects in ..." error. Jordan is right. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173713 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 4e48089e38..31a847b129 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -3697,8 +3697,8 @@ def err_arc_mismatched_cast : Error< def err_arc_nolifetime_behavior : Error< "explicit ownership qualifier on cast result has no effect">; def err_arc_objc_object_in_tag : Error< - "ARC forbids %select{Objective-C objects|blocks}0 of type %1 in " - "%select{struct|interface|union|<>|enum}2">; + "ARC forbids %select{Objective-C objects|blocks}0 in " + "%select{struct|interface|union|<>|enum}1">; def err_arc_objc_property_default_assign_on_object : Error< "ARC forbids synthesizing a property of an Objective-C object " "with unspecified ownership or storage attribute">; diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index aa4a865344..fb63953de9 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -10516,7 +10516,7 @@ void Sema::ActOnFields(Scope* S, } } else { Diag(FD->getLocation(), diag::err_arc_objc_object_in_tag) - << T->isBlockPointerType() << T << Record->getTagKind(); + << T->isBlockPointerType() << Record->getTagKind(); } ARCErrReported = true; } diff --git a/test/ARCMT/checking.m b/test/ARCMT/checking.m index a5c364a058..b06f4a731d 100644 --- a/test/ARCMT/checking.m +++ b/test/ARCMT/checking.m @@ -117,7 +117,7 @@ void test1(A *a, BOOL b, struct UnsafeS *unsafeS) { } struct S { - A* a; // expected-error {{ARC forbids Objective-C objects of type 'A *__strong' in struct}} + A* a; // expected-error {{ARC forbids Objective-C objects in struct}} }; @interface B diff --git a/test/SemaObjC/arc-decls.m b/test/SemaObjC/arc-decls.m index e9ce415188..cdf6cc64ff 100644 --- a/test/SemaObjC/arc-decls.m +++ b/test/SemaObjC/arc-decls.m @@ -3,17 +3,17 @@ // rdar://8843524 struct A { - id x; // expected-error {{ARC forbids Objective-C objects of type '__strong id' in struct}} + id x; // expected-error {{ARC forbids Objective-C objects in struct}} }; union u { - id u; // expected-error {{ARC forbids Objective-C objects of type '__strong id' in union}} + id u; // expected-error {{ARC forbids Objective-C objects in union}} }; @interface I { struct A a; struct B { - id y[10][20]; // expected-error {{ARC forbids Objective-C objects}} + id y[10][20]; // expected-error {{ARC forbids Objective-C objects in struct}} id z; } b; @@ -23,7 +23,7 @@ union u { // rdar://10260525 struct r10260525 { - id (^block) (); // expected-error {{ARC forbids blocks of type 'id (^__strong)()' in struct}} + id (^block) (); // expected-error {{ARC forbids blocks in struct}} }; struct S {