On Wed, 2012-09-26 at 15:29 +0200, Lubos Lunak wrote:
I don't think it can go anywhere practical:
:-) while it's certainly possibly to find cases where it is hard to
detect and warn about these problems, I imagine that catching many of
the banal cases and warning about those would be reasonably do-able -
while punting on the false positives.
class A
{
bool foo;
void init();
public:
A() { init(); }
};
How should the compiler know?
In this case; it should be clever ;-) we could defer the checking until
we compiled the init function: but of course, this soon gets pretty
intense cost-wise, and (absent LTO-scale visibility of all the code)
can't be perfect.
Warnings for constructors that don't call member functions, don't
initialise POD types, and/or don't pass references to them elsewhere
would surely be a useful if not complete win.
ATB,
Michael.
--
michael.meeks@suse.com <><, Pseudo Engineer, itinerant idiot
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.