[cfe-commits] r71907 - in /cfe/trunk: include/clang/AST/Expr.h lib/AST/Expr.cpp lib/Sema/SemaExpr.cpp test/SemaTemplate/instantiate-function-1.cpp

Anders Carlsson andersca at mac.com
Sat May 16 10:27:52 PDT 2009


On May 15, 2009, at 5:32 PM, Anders Carlsson wrote:

>
> On May 15, 2009, at 5:10 PM, Eli Friedman wrote:
>>
>> I think the example you give isn't necessarily an error in ObjC++
>> (suppose T is an ObjC interface, and foo is a property of T).
>>
>
> Good point...I'll try to come up with a better check.

How about this:

if (BaseType->isDependentType()) {
   const PointerType *PT = BaseType->getAsPointerType();
   if (!PT || (getLangOptions().ObjC1 &&
               !PT->getPointeeType()->isRecordType()))
     return Owned(new (Context) MemberExpr(BaseExpr, false, 0,
                                           MemberLoc,  
Context.DependentTy));
}

This passes the tests, and when compiling Obj-C++ code it doesn't give  
an error for

T t
t.f;

but it still gives an error for

this.f;


Anders
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090516/cd64d9f5/attachment.html>


More information about the cfe-commits mailing list