<div class="gmail_quote">On Sun, Apr 12, 2009 at 1:43 AM, Chris Lattner <span dir="ltr"><<a href="mailto:sabre@nondot.org">sabre@nondot.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Author: lattner<br>
Date: Sun Apr 12 03:43:13 2009<br>
New Revision: 68894<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=68894&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=68894&view=rev</a><br>
Log:<br>
Fix rdar://6771034: don't warn on use of forward declared protocol in protocol<br>
list of another protocol definition.  This warning is very noisy and GCC doesn't<br>
produce it so existing code doesn't expect it.</blockquote><div><br></div><div>Ok, seems like a necessary concession. However, this construct is also somewhat questionable and at some point we should move back towards having the warning enabled. Can we retain a -W.... for this?</div>
<div><br></div><div> - Daniel</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
Modified:<br>
    cfe/trunk/lib/Parse/ParseObjc.cpp<br>
    cfe/trunk/lib/Sema/SemaDeclObjC.cpp<br>
    cfe/trunk/test/Analysis/region-1.m<br>
    cfe/trunk/test/SemaObjC/method-conflict.m<br>
    cfe/trunk/test/SemaObjC/protocol-forward-circular.m<br>
    cfe/trunk/test/SemaObjC/protocol-test-2.m<br>
    cfe/trunk/test/SemaObjC/protocol-undef.m<br>
<br>
Modified: cfe/trunk/lib/Parse/ParseObjc.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=68894&r1=68893&r2=68894&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=68894&r1=68893&r2=68894&view=diff</a><br>

<br>
==============================================================================<br>
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)<br>
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Sun Apr 12 03:43:13 2009<br>
@@ -982,7 +982,7 @@<br>
<br>
   llvm::SmallVector<DeclPtrTy, 8> ProtocolRefs;<br>
   if (Tok.is(tok::less) &&<br>
-      ParseObjCProtocolReferences(ProtocolRefs, true, EndProtoLoc))<br>
+      ParseObjCProtocolReferences(ProtocolRefs, false, EndProtoLoc))<br>
     return DeclPtrTy();<br>
<br>
   DeclPtrTy ProtoType =<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=68894&r1=68893&r2=68894&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=68894&r1=68893&r2=68894&view=diff</a><br>

<br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Sun Apr 12 03:43:13 2009<br>
@@ -503,7 +503,7 @@<br>
   }<br>
 }<br>
<br>
-/// ActOnForwardProtocolDeclaration -<br>
+/// ActOnForwardProtocolDeclaration - Handle @protocol foo;<br>
 Action::DeclPtrTy<br>
 Sema::ActOnForwardProtocolDeclaration(SourceLocation AtProtocolLoc,<br>
                                       const IdentifierLocPair *IdentList,<br>
<br>
Modified: cfe/trunk/test/Analysis/region-1.m<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/region-1.m?rev=68894&r1=68893&r2=68894&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/region-1.m?rev=68894&r1=68893&r2=68894&view=diff</a><br>

<br>
==============================================================================<br>
--- cfe/trunk/test/Analysis/region-1.m (original)<br>
+++ cfe/trunk/test/Analysis/region-1.m Sun Apr 12 03:43:13 2009<br>
@@ -19,14 +19,14 @@<br>
 @end  @class NSAttributedString, NSEvent, NSFont, NSFormatter, NSImage, NSMenu, NSText, NSView;<br>
 @class JabasectItem;<br>
 @protocol EcoClassifier;<br>
-@protocol EcoClassInterfaceCommons <EcoClassifier>    @end  @protocol EcoImplementation;  // expected-warning{{cannot find protocol}}<br>
+@protocol EcoClassInterfaceCommons <EcoClassifier>    @end  @protocol EcoImplementation;<br>
 @protocol EcoBehavioredClassifier <EcoClassInterfaceCommons>      - (NSArray *) implementations;<br>
 @end enum {<br>
 CK_UNRESTRICTED= 0,     CK_READ_ONLY,     CK_ADD_ONLY,     CK_REMOVE_ONLY };<br>
 @protocol EcoClass <EcoBehavioredClassifier>      - (NSArray *) ownedAttributes;<br>
 @end @protocol EcoNamespace;<br>
 @protocol EcoType;<br>
-@protocol EcoClassifier <EcoNamespace,EcoType>    - (NSArray *) features; // expected-warning 2 {{cannot find protocol}}<br>
+@protocol EcoClassifier <EcoNamespace,EcoType>    - (NSArray *) features;<br>
 @end @protocol EcoComment;<br>
 @protocol EcoElement <NSObject> - (NSArray *) ownedElements;<br>
 @end @protocol EcoDirectedRelationship;<br>
<br>
Modified: cfe/trunk/test/SemaObjC/method-conflict.m<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/method-conflict.m?rev=68894&r1=68893&r2=68894&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/method-conflict.m?rev=68894&r1=68893&r2=68894&view=diff</a><br>

<br>
==============================================================================<br>
--- cfe/trunk/test/SemaObjC/method-conflict.m (original)<br>
+++ cfe/trunk/test/SemaObjC/method-conflict.m Sun Apr 12 03:43:13 2009<br>
@@ -25,7 +25,7 @@<br>
 }<br>
   CSSM_FIELDGROUP, *CSSM_FIELDGROUP_PTR;<br>
 @protocol XDUMLClassifier;<br>
-@protocol XDUMLClassInterfaceCommons <XDUMLClassifier>  // expected-warning {{cannot find protocol definition for 'XDUMLClassifier'}}<br>
+@protocol XDUMLClassInterfaceCommons <XDUMLClassifier><br>
 @end  @protocol XDUMLImplementation;<br>
 @protocol XDUMLElement <NSObject> - (NSArray *) ownedElements;<br>
 @end @protocol XDUMLDataType;<br>
<br>
Modified: cfe/trunk/test/SemaObjC/protocol-forward-circular.m<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/protocol-forward-circular.m?rev=68894&r1=68893&r2=68894&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/protocol-forward-circular.m?rev=68894&r1=68893&r2=68894&view=diff</a><br>

<br>
==============================================================================<br>
--- cfe/trunk/test/SemaObjC/protocol-forward-circular.m (original)<br>
+++ cfe/trunk/test/SemaObjC/protocol-forward-circular.m Sun Apr 12 03:43:13 2009<br>
@@ -1,7 +1,7 @@<br>
 // RUN: clang-cc -fsyntax-only -verify %s<br>
<br>
 @protocol B;<br>
-@protocol C < B > // expected-warning{{cannot find protocol definition for 'B'}} // expected-note{{previous definition is here}}<br>
+@protocol C < B > // expected-note{{previous definition is here}}<br>
 @end<br>
 @protocol A < C ><br>
 @end<br>
<br>
Modified: cfe/trunk/test/SemaObjC/protocol-test-2.m<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/protocol-test-2.m?rev=68894&r1=68893&r2=68894&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/protocol-test-2.m?rev=68894&r1=68893&r2=68894&view=diff</a><br>

<br>
==============================================================================<br>
--- cfe/trunk/test/SemaObjC/protocol-test-2.m (original)<br>
+++ cfe/trunk/test/SemaObjC/protocol-test-2.m Sun Apr 12 03:43:13 2009<br>
@@ -10,7 +10,7 @@<br>
 - (INTF1<p1>*) meth;<br>
 @end<br>
<br>
-@protocol PROTO2<p1> // expected-warning {{cannot find protocol definition for 'p1'}}<br>
+@protocol PROTO2<p1><br>
 @end<br>
<br>
 @protocol p1 @end<br>
@@ -27,5 +27,12 @@<br>
 @protocol p2 <p1><br>
 @end<br>
<br>
-@protocol PROTO4 <p1, p2, PROTO, PROTO3, p3> // expected-warning {{cannot find protocol definition for 'p3'}}<br>
+@protocol PROTO4 <p1, p2, PROTO, PROTO3, p3><br>
+@end<br>
+<br>
+<br>
+// rdar://6771034<br>
+@protocol XX;<br>
+@protocol YY <XX>  // Use of declaration of XX here should not cause a warning.<br>
+- zz;<br>
 @end<br>
<br>
Modified: cfe/trunk/test/SemaObjC/protocol-undef.m<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/protocol-undef.m?rev=68894&r1=68893&r2=68894&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/protocol-undef.m?rev=68894&r1=68893&r2=68894&view=diff</a><br>

<br>
==============================================================================<br>
--- cfe/trunk/test/SemaObjC/protocol-undef.m (original)<br>
+++ cfe/trunk/test/SemaObjC/protocol-undef.m Sun Apr 12 03:43:13 2009<br>
@@ -21,8 +21,8 @@<br>
 - (BOOL)anchor:(OzzyAnchor *)anchor confirmRepresentedObject:(id)newObject;<br>
 @end<br>
 typedef NSObject <OzzyAnchorDelegateP> OzzyAnchorDelegate;<br>
-// GCC doesn't warn about the following (which is inconsistent with it's handling of @interface below).<br>
-@protocol OzzyAnchorP <OzzyP> // expected-warning{{cannot find protocol definition for 'OzzyP'}}<br>
+<br>
+@protocol OzzyAnchorP <OzzyP><br>
   @property(nonatomic,retain) id representedObject;<br>
   @property(nonatomic,retain) Ozzy * contentGroup;<br>
 @end<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br>