[cfe-commits] r90874 - in /cfe/trunk: lib/Sema/SemaExprCXX.cpp test/SemaObjCXX/composite-objc-pointertype.mm
Fariborz Jahanian
fjahanian at apple.com
Thu Dec 10 12:48:50 PST 2009
On Dec 8, 2009, at 1:15 PM, Douglas Gregor wrote:
>
> On Dec 8, 2009, at 1:14 PM, Fariborz Jahanian wrote:
>
>>
>> On Dec 8, 2009, at 1:10 PM, Douglas Gregor wrote:
>>
>>>
>>> On Dec 8, 2009, at 12:04 PM, Fariborz Jahanian wrote:
>>>
>>>>
>>> This will work for NULL and any Objective-C pointer type, but
>>> there are larger issues in this function for Objective-C since
>>> nothing beyond the null-pointer-constant checks will work. For
>>> example, here's a case where we should be able to find the
>>> composite type between two interface pointers:
>>>
>>> @interface C1 { } @end
>>> @interface C2 : C1 { } @end
>>>
>>> void f(int Cond, C1 *c1, const C2 *c2) {
>>> (void)(Cond? c1 : c2);
>>> }
>>>
>>> This compiles with GCC (Objective-C and Objective-C++ mode) and
>>> with Clang in Objective-C mode, but with Clang Objective-C++ we get
>>>
>>> t.mm:5:14: error: incompatible operand types ('C1 *' and 'C2 const
>>> *')
>>> (void)(Cond? c1 : c2);
>>> ^ ~~ ~~
>>> 1 diagnostic generated.
>>
>> Yes. This is a separate issue. I will take a look.
This is now implemented in TOT:
http://llvm.org/viewvc/llvm-project?view=rev&revision=91056 and
http://llvm.org/viewvc/llvm-project?view=rev&revision=91059
- Fariborz
>>
>
> Thanks!
>
> - Doug
More information about the cfe-commits
mailing list