[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-commits
Subject:    [cfe-commits] r51809 - in /cfe/trunk: lib/Sema/SemaExprObjC.cpp
From:       Steve Naroff <snaroff () apple ! com>
Date:       2008-05-31 2:19:16
Message-ID: 200805310219.m4V2JGEA013648 () zion ! cs ! uiuc ! edu
[Download RAW message or body]

Author: snaroff
Date: Fri May 30 21:19:15 2008
New Revision: 51809

URL: http://llvm.org/viewvc/llvm-project?rev=51809&view=rev
Log:
Fix <rdar://problem/5965704> clang: bad receiver type 'id const'

Added:
    cfe/trunk/test/Sema/const-id.m
Modified:
    cfe/trunk/lib/Sema/SemaExprObjC.cpp

Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=51809&r1=51808&r2=51809&view=diff


==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Fri May 30 21:19:15 2008
@@ -199,11 +199,12 @@
   
   Expr **ArgExprs = reinterpret_cast<Expr **>(Args);
   Expr *RExpr = static_cast<Expr *>(receiver);
-  QualType receiverType = RExpr->getType().getCanonicalType();
+  QualType receiverType;
   QualType returnType;
   ObjCMethodDecl *Method = 0;
+
+  receiverType = RExpr->getType().getCanonicalType().getUnqualifiedType();
   
-  // FIXME: This code is not stripping off type qualifiers! Should it?
   if (receiverType == Context.getObjCIdType().getCanonicalType() ||
       receiverType == Context.getObjCClassType().getCanonicalType()) {
     Method = InstanceMethodPool[Sel].Method;

Added: cfe/trunk/test/Sema/const-id.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/const-id.m?rev=51809&view=auto


==============================================================================
--- cfe/trunk/test/Sema/const-id.m (added)
+++ cfe/trunk/test/Sema/const-id.m Fri May 30 21:19:15 2008
@@ -0,0 +1,8 @@
+// RUN: clang %s -verify -fsyntax-only
+
+int main() {
+    const id foo;
+    [foo bar];  // expected-warning {{method '-bar' not found (return type defaults \
to 'id')}} +    return 0;
+}
+


_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic