From: Fariborz Jahanian Date: Tue, 10 Aug 2010 18:10:50 +0000 (+0000) Subject: Fix a spurious warning when message sent to qualified-id X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba551983016ee3eac5421255d2ebe6723e61befb;p=clang Fix a spurious warning when message sent to qualified-id type receiver (pr7861). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110696 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index df970411e7..f718ea3fd9 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -863,8 +863,7 @@ Sema::OwningExprResult Sema::BuildInstanceMessage(ExprArg ReceiverE, if (!Method) { // Handle messages to id. - bool receiverIsId = (ReceiverType->isObjCIdType() || - ReceiverType->isObjCQualifiedIdType()); + bool receiverIsId = ReceiverType->isObjCIdType(); if (receiverIsId || ReceiverType->isBlockPointerType() || (Receiver && Context.isObjCNSObjectType(Receiver->getType()))) { Method = LookupInstanceMethodInGlobalPool(Sel, diff --git a/test/SemaObjC/method-lookup-3.m b/test/SemaObjC/method-lookup-3.m index 18a9982840..882b3d1d21 100644 --- a/test/SemaObjC/method-lookup-3.m +++ b/test/SemaObjC/method-lookup-3.m @@ -50,3 +50,8 @@ void f4(id a0, Abstract *a1) { void f5(id a0, Abstract *a1) { [ a0 setZ: a1]; } + +// pr7861 +void f6(id a0) { + Abstract *l = [a0 x]; +}