<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 18, 2013, at 6:16 AM, Eli Friedman <<a href="mailto:eli.friedman@gmail.com">eli.friedman@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;"><div dir="ltr">On Tue, Jun 18, 2013 at 5:47 AM, Rafael Espíndola<span class="Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br><div class="gmail_extra"><div class="gmail_quote"><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;"><div>> I also badgered the committee back in February when this last came up,<br>> and no consensus for a language change appeared. I'm trying<br>> rebadgering :)<br><br></div>Until then I think we should conform to what other compilers do and is<br>less surprising to the users. This is not the same case as, for<br>example, dependent bases, where the standard was not implemented by<br>gcc and msvc at the time but was a better model than what those<br>compilers implemented. Examples like:<br><div><br>extern "C" {<br> <span class="Apple-converted-space"> </span>static void foo(int x);<br> <span class="Apple-converted-space"> </span>static void foo() {<br> <span class="Apple-converted-space"> </span>}<br> <span class="Apple-converted-space"> </span>void foo(int x) {<br> <span class="Apple-converted-space"> </span>}<br>}<br><br></div>show are not adding value by being pedantically correct.<br><br>I am not sure I understand your suggestion about<br>LocallyScopedExternCDecls. Consider a variant of the testcase above<br>with just the last two functions. The foo(int) will be the fist extern<br>C and overload resolution will decide we have an overload. We would<br>have to walk the lookup results again to find foo().<br></blockquote><div><br></div><div>Suppose overloading completely ignores whether a declaration is extern "C", and suppose you have a hashtable which returns the extern "C" decl for a given identifier.  After you conclude foo(int) overloads foo(), you look in the hashtable and say "oops, there was already a declaration with that name".  (I haven't really thought through whether this is a good idea.)<br></div></div></div></div></div></blockquote></div><div><br></div>FWIW, this is almost certainly something we’ll have to do anyway, because we should detect conflicts when there are other extern “C” declarations that otherwise aren’t visible to name lookup, e.g.,<div><br></div><div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">namespace N {</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">  extern "C" void foo(int);</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">}</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; min-height: 14px;"><br></div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">namespace M {</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">  extern "C" void foo(float);</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">}</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- Doug</div><div><br></div></div></body></html>