<div class="gmail_quote">On Thu, Jul 19, 2012 at 4:52 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">

I'm almost done, but some tests are failing because the call to D.isFunctionDeclarator() is not in the outside 'if'. It doesn't filter out pointers to member functions, functions with no parameters and a reference return type (these can't be variable declarations),</blockquote>

<div><br></div><div>These cases were previously blocked by the D.getNumTypeObjects() == 1 check. I think the best (conservative) way to proceed is:</div><div>* Suppress the diagnostic if there's a type object other than a pointer or paren before the function chunk. (You may as well determine whether to produce the 'function declaration' or 'function declarator' diagnostic as part of this check.)</div>

<div>* If the return type is a reference, do not warn if the function has no arguments.</div><div>* If the return type is not a class type, do not warn if the function has more than one argument.</div><div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

the last one I don't even understand.</blockquote></div><div><br></div><div>This is checking we don't warn about the ambiguity between a trailing-return-type and a member-access expression on a temporary (we can tell them apart based on whether 'auto' is used). We were missing tok::arrow from the list of token kinds in isCXXFunctionDeclarator which indicate that a declaration is definitely a function declaration. Fixed in r160646.</div>
</div>