<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Compilation error when casting an explicit template argument which is a member-function"
   href="https://bugs.llvm.org/show_bug.cgi?id=35971">bug 35971</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>richard-llvm@metafoo.co.uk
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Compilation error when casting an explicit template argument which is a member-function"
   href="https://bugs.llvm.org/show_bug.cgi?id=35971#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Compilation error when casting an explicit template argument which is a member-function"
   href="https://bugs.llvm.org/show_bug.cgi?id=35971">bug 35971</a>
              from <span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span></b>
        <pre>(In reply to Borislav Stanimirov from <a href="show_bug.cgi?id=35971#c0">comment #0</a>)
<span class="quote">> Both examples compile fine on gcc and msvc</span >

That is a bug in those compilers. The C++11 and C++14 rules are quite clear
about the permitted syntactic forms of non-type template arguments.
[temp.arg.nontype]/1.3 says the argument shall be:

  "[...] a pointer to member expressed as described in [expr.unary.op]"

GCC does correctly implement the rule for the non-pointer-to-member case:

  <a href="https://godbolt.org/g/jb6gwU">https://godbolt.org/g/jb6gwU</a>

... strongly suggesting that this is just an oversight on their part. (MSVC has
apparently never followed the rules here.)

The rule in question was changed in C++17 to allow arbitrary constant
expressions of the right type as non-type template arguments:
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4198.html">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4198.html</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>