[cfe-commits] r65562 - in /cfe/trunk: lib/Sema/Sema.h lib/Sema/SemaDeclObjC.cpp test/SemaObjC/property-13.m

steve naroff snaroff at apple.com
Thu Feb 26 11:20:32 PST 2009


On Feb 26, 2009, at 2:16 PM, Sebastian Redl wrote:

> Steve Naroff wrote:
>> Author: snaroff
>> Date: Thu Feb 26 13:11:32 2009
>> New Revision: 65562
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=65562&view=rev
>> Log:
>> Fix <rdar://problem/6574319> clang issues error on 'readonly'  
>> property with a defaul setter attribute.
>>
>> Needed to make isPropertyReadonly() non-const (for this fix to  
>> compile). I imagine there's a way to retain the const-ness, however  
>> I have more important fish to fry.
>>
>> +  // Lastly, look through the implementation (if one is in scope).
>> +  if (ObjCImplementationDecl *ImpDecl =
>> +        ObjCImplementations[IDecl->getIdentifier()])
>> +    if (ImpDecl->getInstanceMethod(PDecl->getSetterName()))
>> +      return false;
>>   return true;
>> }
>>
> Wouldn't it suffice to make ImpDecl here a pointer-to-const?
>

Still getting errors...

llvm[2]: Compiling SemaDeclObjC.cpp for Debug build
SemaDeclObjC.cpp: In member function ‘bool  
clang::Sema::isPropertyReadonly(clang::ObjCPropertyDecl*,  
clang::ObjCInterfaceDecl*) const’:
SemaDeclObjC.cpp:763: error: no match for ‘operator[]’ in ‘((const  
clang::Sema*)this)->clang::Sema::ObjCImplementations[IDecl- 
 > 
clang 
::ObjCInterfaceDecl 
::< 
anonymous 
 > 
.clang 
::ObjCContainerDecl::<anonymous>.clang::NamedDecl::getIdentifier()]’
/Users/snaroff/llvm/include/llvm/ADT/DenseMap.h:265: note: candidates  
are: ValueT& llvm::DenseMap<KeyT, ValueT, KeyInfoT,  
ValueInfoT>::operator[](const KeyT&) [with KeyT =  
clang::IdentifierInfo*, ValueT = clang::ObjCImplementationDecl*,  
KeyInfoT = llvm::DenseMapInfo<clang::IdentifierInfo*>, ValueInfoT =  
llvm::DenseMapInfo<clang::ObjCImplementationDecl*>] <near match>
make[2]: *** [/Users/snaroff/llvm/tools/clang/lib/Sema/Debug/ 
SemaDeclObjC.o] Error 1
make[1]: *** [Sema/.makeall] Error 2

snaroff

> Sebastian





More information about the cfe-commits mailing list