<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-03-18 20:50 GMT+06:00 Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span>:<br><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">rsmith added a comment.<br>
<br>
Can we instead not add the function to the redeclaration chain until it's instantiated (like we do if it's dependent)?<br>
<br></blockquote><div><br></div><div>I prepared implementation that uses this approach. In this variant information about potential definitions is lost, in some cases it makes difficult to make analysis. For instance we can diagnose misfit of declarations in the code:</div><div>```</div><div><div>void func9(int);  // expected-note{{previous declaration is here}}</div><div>template<typename T> struct C9a {</div><div>  friend int func9(int);  // expected-error{{functions that differ only in their return type cannot be overloaded}}</div><div>};</div></div><div>```</div><div>but not in the case:</div><div>```</div><div><div>template<typename T> struct C9a {<br></div><div>  friend int func9(int);</div><div>};</div></div><div>void func9(int);</div><div>```</div><div>Otherwise both approaches seem almost equivalent.</div><div><br></div><div>Thanks,</div><div>--Serge</div></div></div></div>