<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 4, 2013, at 8:51 , Bruce Stephens <<a href="mailto:bruce.r.stephens@gmail.com">bruce.r.stephens@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">The following dubious (IMHO) code no longer compiles, though it does in<br>other popular compilers.<br><br>static void a(void);<br>extern void a();<br>static void a(void) {}<br><br>(In this specific case the code is partly generated: the extern<br>declaration is generated and the static ones are hand generated.)<br><br>I'm guessing this is caused by reverting the reversion of r178663 (it<br>touches what looks like the right bit of code and it's dated April 3, so<br>the timing's about right), but I haven't checked.<br><br>(Not sure whether the code should be legal. I'd guess we don't have the<br>only instance of this kind of thing.)<br></blockquote><br></div><div>This does seem like it should be legal, per C11 6.2.2p4:</div><div><br></div><div><div><blockquote type="cite">For an identifier declared with the storage-class specifier extern in a scope in which a prior declaration of that identifier is visible, if the prior declaration specifies internal or external linkage, the linkage of the identifier at the later declaration is the same as the linkage specified at the prior declaration.</blockquote><div><br></div>C++11 seems to get this implicitly from its own linkage rules [basic.link]p3:</div><div><br></div><div><blockquote type="cite">A name having namespace scope (3.3.6) has internal linkage if it is the name of<br>- a variable, function or function template that is explicitly declared static...</blockquote></div><div><br></div><div>Please <a href="http://llvm.org/bugs/">file a bug</a> (and for bonus points, assign it to Rafael.)</div><div><br></div><div>Jordan</div></div></body></html>