On 10 Sep 2012, at 08:50, Bluna Ratimonkey wrote:

> Hi,
> I update clang to current trunk(163490) due to that I cannot use 
> @encode(typeof(var)) in a file.mm; it works fine in .m, why is that?
> 
> error: unknown type name 'typeof'; did you mean the keyword 'typedef'?
>         @encode(typeof(argc));
> 
> But __typeof__(argc) works fine and I can live with that.

This is due to your language settings.  typeof is a GNU extension and in 
standards modes it is not supported (although __typeof__ is because it is in 
the namespace reserved for implementation-specific extensions).  If you compile 
with, for example, -std=gnu++11, then both should work.

> But after the upgrading, I ran into another problem..
> 
> In file included from CodeGenModule.mm:1:
> In file included from 
> /home/id/etoile.svn/Etoile/Languages/LanguageKit/CodeGen/CodeGenModule.h:3:
> In file included from 
> /home/id/etoile.svn/Etoile/Languages/LanguageKit/CodeGen/CGObjCRuntime.h:18:
> In file included from /usr/local/include/llvm/ADT/SmallVector.h:19:
> In file included from /usr/local/include/llvm/Support/type_traits.h:22:
> In file included from 
> /usr/lib/gcc/i686-linux-gnu/4.6/../../../../include/c++/4.6/utility:70:
> In file included from 
> /usr/lib/gcc/i686-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_pair.h:60:
> /usr/lib/gcc/i686-linux-gnu/4.6/../../../../include/c++/4.6/bits/move.h:46:22:
>  error: cast of an
>       Objective-C pointer to 'const volatile char &' is disallowed with ARC
>         (&const_cast<char&>(reinterpret_cast<const volatile char&>(__r)));

This is a problem with your C++ standard library.  I've tried both libc++ and 
libstdc++ 4.2.1 and both work, but apparently newer versions of libstdc++ 
break.  

David

-- Sent from my brain


_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss

Répondre à