From: Argyrios Kyrtzidis Date: Mon, 13 Sep 2010 17:48:07 +0000 (+0000) Subject: Add a compatibility note about clang not implicitly converting between objc_object... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b5b92ab39388bb180097f3234fde9239532af4c;p=clang Add a compatibility note about clang not implicitly converting between objc_object* and id (and SEL, Class). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113761 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/www/compatibility.html b/www/compatibility.html index c3b467f43b..bc34a863f5 100644 --- a/www/compatibility.html +++ b/www/compatibility.html @@ -40,6 +40,7 @@
  • C++ compatibility @@ -233,6 +234,27 @@ this problem, use the Objective-C runtime API function class_getInstanceSize([NSArray class]) + +

    Internal Objective-C types

    + + +

    GCC allows using pointers to internal Objective-C objects, struct objc_object*, +struct objc_selector*, and struct objc_class* in place of the types +id, SEL, and Class respectively. Clang treats the +internal Objective-C structures as implementation detail and won't do implicit conversions: + +

    +t.mm:11:2: error: no matching function for call to 'f'
    +        f((struct objc_object *)p);
    +        ^
    +t.mm:5:6: note: candidate function not viable: no known conversion from 'struct objc_object *' to 'id' for 1st argument
    +void f(id x);
    +     ^
    +
    + +

    Code should use types id, SEL, and Class +instead of the internal types.

    +

    C++ compatibility