[cfe-commits] r69229 - in /cfe/trunk: lib/AST/ASTContext.cpp test/SemaObjC/objc2-merge-gc-attribue-decl.m

Fariborz Jahanian fjahanian at apple.com
Wed Apr 15 14:54:49 PDT 2009


Author: fjahanian
Date: Wed Apr 15 16:54:48 2009
New Revision: 69229

URL: http://llvm.org/viewvc/llvm-project?rev=69229&view=rev
Log:
Fix decl type merges when they have
__string/__weak attributes.


Added:
    cfe/trunk/test/SemaObjC/objc2-merge-gc-attribue-decl.m
Modified:
    cfe/trunk/lib/AST/ASTContext.cpp

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=69229&r1=69228&r2=69229&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Wed Apr 15 16:54:48 2009
@@ -2937,8 +2937,8 @@
   if (LHSCan.getCVRQualifiers() != RHSCan.getCVRQualifiers())
     return QualType();
 
-  Type::TypeClass LHSClass = LHSCan->getTypeClass();
-  Type::TypeClass RHSClass = RHSCan->getTypeClass();
+  Type::TypeClass LHSClass = LHSCan.getUnqualifiedType()->getTypeClass();
+  Type::TypeClass RHSClass = RHSCan.getUnqualifiedType()->getTypeClass();
 
   // We want to consider the two function types to be the same for these
   // comparisons, just force one to the other.
@@ -2963,7 +2963,7 @@
   if (LHSClass != RHSClass) {
     const ObjCInterfaceType* LHSIface = LHS->getAsObjCInterfaceType();
     const ObjCInterfaceType* RHSIface = RHS->getAsObjCInterfaceType();
-
+    
     // 'id' and 'Class' act sort of like void* for ObjC interfaces
     if (LHSIface && (isObjCIdStructType(RHS) || isObjCClassStructType(RHS)))
       return LHS;

Added: cfe/trunk/test/SemaObjC/objc2-merge-gc-attribue-decl.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/objc2-merge-gc-attribue-decl.m?rev=69229&view=auto

==============================================================================
--- cfe/trunk/test/SemaObjC/objc2-merge-gc-attribue-decl.m (added)
+++ cfe/trunk/test/SemaObjC/objc2-merge-gc-attribue-decl.m Wed Apr 15 16:54:48 2009
@@ -0,0 +1,16 @@
+// RUN: clang-cc -triple i386-apple-darwin9 -fobjc-gc -fsyntax-only -verify %s
+
+ at interface INTF @end
+
+extern INTF* p2;
+extern __strong INTF* p2;
+
+extern __strong id p1;
+extern id p1;
+
+extern id CFRunLoopGetMain();
+extern __strong id CFRunLoopGetMain();
+
+extern __strong INTF* p3;
+extern id p3;
+





More information about the cfe-commits mailing list