Here's a patch to improve the messages for out-of-line definition errors by including the function's signature along with its name, and in the candidate function notes including the candidates name and signature as namespace qualifiers aren't always apparent at the line of code with the declaration.<br>
<br>The patch is also available for review at <a href="http://codereview.appspot.com/4817047">http://codereview.appspot.com/4817047</a><br>

<br>For example, given a file tmp.cpp containing:<br><br>namespace N2 {<br> struct S1;<br><br>  namespace N1 {<br>   struct S2 {<br>     void func(S1*);<br>   };<br><br>   struct S1 {};<br>  }<br>}<br>void N2::N1::S2::func(S1*) {}<br>
<br>Clang currently reports:<br><br>tmp.cpp:12:18: error: out-of-line definition of 'func' does not match any declaration in 'N2::N1::S2'<br>void N2::N1::S2::func(S1*) {}<br>     ~~~~~~~~~~~~^<br><br>Sadly, g++ (version 4.4.3) gives better messages:<br>
<br>tmp.cpp:12: error: prototype for 'void N2::N1::S2::func(N2::N1::S1*)' does not match any in class 'N2::N1::S2'<br>tmp.cpp:6: error: candidate is: void N2::N1::S2::func(N2::S1*)<br><br>With this patch, clang yields:<br>
<br>tmp.cpp:12:18: error: out-of-line definition of 'void func(N2::N1::S1 *)' does not match any<br>      declaration in 'N2::N1::S2'<br>void N2::N1::S2::func(S1*) {}<br>     ~~~~~~~~~~~~^<br>tmp.cpp:6:11: note: member declaration 'void func(N2::S1 *)' nearly matches<br>
     void func(S1*);<br>          ^<br><br>Cheers,<br>Kaelyn<br>