<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 13, 2013 at 11:58 AM, Benjamin Kramer <span dir="ltr"><<a href="mailto:benny.kra@gmail.com" target="_blank">benny.kra@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On 13.09.2013, at 20:40, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
<br>
> This seems tedious (though I appreciate the work) - how bad would it be if Clang assumed const member functions with no parameters were warn_unused_result?<br>
<br>
</div>Mutable members prevent using the C++ "const" keyword, I don't think it's feasible to turn such a warning on by default. Do we perform analysis in Clang to check whether a function has side effects? If so, we could use that.</blockquote>
<div><br></div><div>I don't think so - which would only work for inline functions.<br><br>mutable defeats the strict correctness, certainly (or const_cast, for that matter) but I was wondering if 'const' would indicate intent sufficiently to get a reasonable quality warning.<br>
<br>I did wonder about total side-effecting functions like printing - though less likely to return a value or be const, I suppose, though they could be both.</div></div></div></div>