<div class="gmail_quote">On Tue, Jul 24, 2012 at 8:11 AM, Nikola Smiljanic <span dir="ltr"><<a href="mailto:popizdeh@gmail.com" target="_blank">popizdeh@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">> * If the return type is a reference, do not warn if the function has no<br>
> arguments.<br>
<br>
</div>Aren't you missing a case when there is more than one argument?<br></blockquote><div><br></div><div>That's covered by the next bullet.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

int& foo(); // must be a function declaration, references can't be uninitialized<br>
int& foo(bar); // ambiguous, could be a variable initialization<br>
int& foo(bar, baz); // again must be a function declaration, because<br>
otherwise this code wouldn't make sense<br>
<br>
I feel like the warning should be emitted when the return type is a<br>
reference AND the function has only one argument? Maybe we can do even<br>
better by checking if this single argument is convertible to reference<br>
type, but this might be too much.</blockquote><div><br></div><div>We don't have an argument expression, so deducing the argument type might be tricky. I don't think this is necessary.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
> * If the return type is not a class type, do not warn if the function has<br>
> more than one argument.<br>
<br>
</div>I'm not sure I understand this. Why shouldn't we warn on something like this?<br>
<br>
int foo(int(), int());<br>
</blockquote></div><br><div>Because that could never be valid as an initializer.</div>