<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - constexpr function pointers aren't considered valid template arguments (violates [temp.arg.nontype])"
   href="http://llvm.org/bugs/show_bug.cgi?id=18043">18043</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>constexpr function pointers aren't considered valid template arguments (violates [temp.arg.nontype])
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++11
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>oneill+llvmbugs@cs.hmc.edu
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=11598" name="attach_11598" title="Could that should compile, and doesn't.">attachment 11598</a> <a href="attachment.cgi?id=11598&action=edit" title="Could that should compile, and doesn't.">[details]</a></span>
Could that should compile, and doesn't.

clang++ (3.3 through r195314) considers the attached code buggy, producing the
error

buglet.cpp:16:5: error: no matching function for call to 'bar'
    bar<fooAddr>();
    ^~~~~~~~~~~~
buglet.cpp:6:6: note: candidate template ignored: invalid explicitly-specified
      argument for template parameter 'f'
void bar()
     ^
gcc 4.6 through 4.8 consider it valid, and my reading of the C++11 standard,
14.3.2 Template non-type arguments [temp.arg.nontype], indicates that the code
should be allowed, as it says:

"a constant expression (5.19) that designates the address of an object with
static storage duration and external or internal linkage or a function with
external or internal linkage, including function templates and function
template-ids but excluding non-static class members, expressed (ignoring
parentheses) as & id-expression, except that the & may be omitted if the name
refers to a function or array and shall be omitted if the corresponding
template-parameter is a reference;"</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>