<br><br><div class="gmail_quote">Le 15 novembre 2011 21:23, Richard Trieu <span dir="ltr"><<a href="mailto:rtrieu@google.com">rtrieu@google.com</a>></span> a écrit :<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
New feature that will print additional information when non-matching function pointers are used.  This will help users more easily distinguish why the function pointers do not match.  The points of difference that will be noted are:<div>

<br></div><div>Different number of parameters</div><div>Different parameter type</div><div>Different return type</div><div>Different function qualifiers</div><div><br></div><div>For instance, code like this:</div><div><br>

</div><div><div>double foo(int x) {return 0;};</div><div>double (*bar)(int, int) = &foo;</div></div><div><br></div><div>Will get this error message:</div><div><br></div><div><div>function-mismatch.cc:2:10: error: cannot initialize a variable of</div>

<div>      type 'double (*)(int, int)' with an rvalue of type 'double (*)(int)'</div><div>      because of different number of parameters (expected 2 but has 1)</div><div>double (*bar)(int, int) = &foo;</div>

<div>         ^                ~~~~</div></div><div><br></div><div>Patch is attached and also available at <a href="http://codereview.appspot.com/5369119/" target="_blank">http://codereview.appspot.com/5369119/</a></div>

<br><br></blockquote><div>Nice!<br><br>Do you plan on adding something for a difference of class (for pointer to member functions) ? Or perhaps that it already exists...<br><br>-- Matthieu<br></div></div><br>