On Friday 03 of August 2012, Caolán McNamara wrote:
> On Fri, 2012-08-03 at 15:05 +0200, Lubos Lunak wrote:
> > - Find out what we can actually use it for. Some EasyHacks are a good
> > start, but the list might get quite long.
>
> I'd be interested to know it'd be possible, in theory anyway, to detect
> e.g. pointless OUString instances where only its ctor and dtor are
> called and nothing else ?

 You mean things like this?

void foo()
{
OUString a;
}

 Yes, even in practice, see attachment.

 But I think this one is generic enough that it should be actually preferably 
done upstream. There are already GCC/Clang attributes pure and const for 
marking functions, so there could be a similar attribute to mark ctors/dtors 
of classes where the ctor/dtor themselves do not have any side-effects (for a 
suitable definition of side-effect).

-- 
 Lubos Lunak
 [email protected]

Attachment: loplugin.tar.gz
Description: application/tgz

_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to