<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 Aug 6, 2018, at 12:44 PM, Matt Miller via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-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" 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="">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf<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><br class=""></div>No, it looks like a bug to me.  Would you mind filing it?</div><div>  <a href="https://bugs.llvm.org" class="">https://bugs.llvm.org</a></div><div><br class=""></div><div>John.</div></body></html>