[cfe-commits] r59732 - in /cfe/trunk: include/clang/Basic/DiagnosticKinds.def lib/Sema/Sema.h lib/Sema/SemaExpr.cpp lib/Sema/SemaOverload.cpp test/SemaCXX/overloaded-operator.cpp
Chris Lattner
clattner at apple.com
Thu Nov 20 22:36:47 PST 2008
On Nov 20, 2008, at 7:04 PM, Doug Gregor wrote:
>>> + // Build the operator call.
>>> + Expr *FnExpr = new DeclRefExpr(Method, Method->getType(),
>>> SourceLocation());
>>> + UsualUnaryConversions(FnExpr);
>>> + Base = new CXXOperatorCallExpr(FnExpr, &Base, 1,
>>> +
>>> Method->getResultType().getNonReferenceType(),
>>> + OpLoc);
>>> + return ActOnMemberReferenceExpr(Base, OpLoc, tok::arrow,
>>> MemberLoc,
>>> Member);
>>
>> On the success path, just use ... Base.take() to take ownership
>> from the
>> owning ptr
>
> At some point once I'm out there, I'm going to bring up this issue
> again, because I feel like the ownership issues in the Parser-Sema
> interaction are very unclear, and we are leaking all over the place
> when we fail to parser or type-check something. Don't be surprised if
> I come back with a manifesto of sorts :)
Please do! I consider this to be one of the big looming problems in
Clang that is better tackled sooner rather than later.
-Chris
More information about the cfe-commits
mailing list