<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - __cpp_nontype_template_args >= 201907L but floating-point template arguments rejected"
   href="https://bugs.llvm.org/show_bug.cgi?id=49369">49369</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>__cpp_nontype_template_args >= 201907L but floating-point template arguments rejected
          </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>Windows NT
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>C++2a
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>Casey@Carter.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Clang 12.0.0-rc2 (and trunk) define __cpp_nontype_template_args to 201907L
indicating support for P1907R1 "Inconsistencies with non-type template
parameters"
(<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1907r1.html">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1907r1.html</a>). This
proposal changes the constraint on non-type template arguments to require that
they have structural type, or [other cases that aren't germane] (N4878
[temp.param]/6). A _structural_ _type_ is a scalar type, or [other cases that
aren't germane] (N4878 [temp.param]/7). Scalar types include floating-point
types (N4878 [basic.types.general]/9). Nonetheless, this well-formed TU:

    template <auto> int f() { return 42; }

    int main() {
    #if defined(__cpp_nontype_template_args) && \
        __cpp_nontype_template_args >= 201911L
        return f<3.14>();
    #endif
    }

when compiled with "-std=c++2a" generates diagnostics:

    <source>:6:12: error: no matching function for call to 'f'
        return f<3.14>();
               ^~~~~~~
    <source>:1:21: note: candidate template ignored: invalid
explicitly-specified argument for 1st template parameter
    template <auto> int f() { return 42; }
                        ^
    1 error generated.

Is there any chance that either the implementation of P1907R1 could be
completed or the value of __cpp_nontype_template_args reduced (to indicate
incomplete support) in time for Clang 12?</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>