<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jun 11, 2013, at 6:02 AM, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On 10 June 2013 19:08, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br><blockquote type="cite">Richard pointed out on IRC that the patch should look at the<br>redeclaration context to avoid problems with one of the functions<br>being in a extern "C++". Implementing that found some interesting<br>problems. Consider<br><br>extern "C" {<br> static void foo(int x);<br> static void foo() {<br> }<br> void foo(int x) {<br> }<br>}<br><br>This should be valid, since both functions have internal linkage and<br>therefore none of them has C language linkage. Commenting the first<br>declaration makes the code invalid as now the last one is extern C and<br>[dcl.link] p6 kicks in. This means we have to do "normal" overload<br>resolution first to see if the last decl we are looking at has C<br>language linkage or not.<br></blockquote><br>BTW, is this sufficient evidence that we should just give static<br>functions C language linkage? I just checked<span class="Apple-converted-space"> </span><a href="http://gcc.godbolt.org/">http://gcc.godbolt.org/</a><br>and gcc 4.8 and icc 13 (which is edg based, no?), reject<br><br>extern "C" {<br> static void foo() {<br> }<br> static void foo(int x) {<br> }<br>}<br><br>We are putting quiet a bit of effort to make sure we accept it and I<br>still can't see the value.<br></div></blockquote></div><div><br></div><div>I, too, find this behavior strange. Changing between static and non-static shouldn’t affect whether a function can be overloaded; it’s completely non-intuitive and apparently at odds with existing practice in GCC/EDG. </div><br><div><span class="Apple-tab-span" style="white-space:pre">     </span>- Doug</div><div><br></div></body></html>