[Kde-pim] Re: Akonadi item.h + clang

Volker Krause vkrause at kde.org
Sat Apr 16 10:26:32 BST 2011


On Wednesday 13 April 2011 10:21:52 Patrick Ohly wrote:
> Hello!
> 
> I'm currently compiling Dinesh's SyncEvolution Akonadi backend. I'm
> using clang++ 2.9 instead of g++ and noticed that the following trick in
> item.h doesn't work with clang++:
> 
> template <typename T>
> void Item::setPayload( T* p )
> {
>   p.You_MUST_NOT_use_a_pointer_as_payload;
> }
> 
> The reason is that clang++, in contrast to g++, already does error
> checking on the template while compiling the template, not when it is
> instantiated.

Interesting, is clang already able to compile the entire KDE stuff, ie. is 
this the only problem you encountered? I always hear it has a much more 
sophisticated analyzing and optimizing system than GCC, and this case confirms 
that obviously, but I so far had the impression it's not able to compile Qt 
and KDE code yet. Looks like this has changed though :)

> Therefore I get a compiler error about the member access in a pointer.
> 
> This patch fixes the issue while still triggering a compiler error when
> Item::setPayload is used incorrectly:

thanks, I've committed it to master and 4.6.

regards
Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20110416/774cf1d6/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list