<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Sep 5, 2018, at 11:01 AM, Matt Miller <<a href="mailto:mattmiller1@gmail.com" class="">mattmiller1@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">On Tue, Sep 4, 2018 at 10:27 PM, John McCall <span dir="ltr" class=""><<a href="mailto:rjmccall@apple.com" target="_blank" class="">rjmccall@apple.com</a>></span> wrote:<br class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" class=""><br class=""><div class=""><span class="gmail-"><br class=""><blockquote type="cite" class=""><div class="">On Aug 6, 2018, at 12:44 PM, Matt Miller via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="gmail-m_-9199129954614357265Apple-interchange-newline"><div class=""><div class="">I was wondering if the following clang behavior is expected/standard compliant:<br class=""><br class="">1. non-template friend function (not constructor): compiles in gcc and clang<br class="">2. non-template friend constructor: compiles in gcc and clang<br class="">3. template friend function (not constructor): compiles in gcc and clang<br class="">4. template friend constructor: compiles in gcc , but not clang<br class="">(compiled in clang 3.0.0 but not clang 3.1+)<br class=""><br class="">Here is an example (use -DUSE_TEMPLATE to control whether the template<br class="">or non-template code is compiled):<br class=""><br class=""><a href="https://godbolt.org/g/FT7Mzj" target="_blank" class="">https://godbolt.org/g/FT7Mzj</a><br class=""><br class="">In the clang case for (4), it gives an error as if the friend<br class="">declaration was never made.<br class=""><br class="">Looking at a C++ standard:<br class=""><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf" target="_blank" class="">http://www.open-std.org/jtc1/<wbr class="">sc22/wg21/docs/papers/2017/<wbr class="">n4659.pdf</a><br class=""><br class="">It looks like section 14.3.5 gives an explicit example of a<br class="">non-template friend constructor being allowed.  In 17.5.4, it didn't<br class="">look like there was anything to indicate template friend constructors<br class="">are treated different than template friend non-constructor functions,<br class="">but maybe I'm missing a subtle point in that section or elsewhere.<br class=""></div></div></blockquote><div class=""><br class=""></div></span>No, it looks like a bug to me.  Would you mind filing it?</div><div class="">  <a href="https://bugs.llvm.org/" target="_blank" class="">https://bugs.llvm.org</a></div><span class="gmail-HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">John.</div></font></span></div></blockquote></div></div><div class="gmail_extra"><br class=""></div><div class="gmail_extra">Opened bug 38578:</div><div class="gmail_extra"><br class=""></div><div class="gmail_extra"><a href="https://bugs.llvm.org/show_bug.cgi?id=38578" class="">https://bugs.llvm.org/show_bug.cgi?id=38578</a></div></div></div></blockquote><div><br class=""></div>Thanks!</div><div><br class=""></div><div>John.</div></body></html>