<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 - non-type template-parameter of reference type confuses template specialization matching"
   href="https://bugs.llvm.org/show_bug.cgi?id=40983">40983</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>non-type template-parameter of reference type confuses template specialization matching
          </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>Linux
          </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++'17
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>tadeus.prastowo@unitn.it
          </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>Consider the following MWE:
-- 8< ---------------------
template<typename T, T v>
struct X {
};

template<bool &v>
struct X<bool &, v> {
};
-- 8< ---------------------

As shown in <a href="https://www.godbolt.org/z/HqqLWu">https://www.godbolt.org/z/HqqLWu</a>, the MWE is accepted by GCC when
using C++14 (the compilation switches `-std=c++14 -pedantic-errors') and when
using C++17 (the compilation switches `-std=c++17 -pedantic-errors').

Clang also accepts the MWE when using C++14 but _not_ when using C++17.

A thread in the C++ std-discussion has just been started on this matter (see
<a href="https://groups.google.com/a/isocpp.org/d/msg/std-discussion/etn0e3qhz28/Nmpmz7NwBAAJ">https://groups.google.com/a/isocpp.org/d/msg/std-discussion/etn0e3qhz28/Nmpmz7NwBAAJ</a>),
but no one has replied yet.  Nevertheless, I think this is a bug considering
that Clang accepts the MWE in C++14, and I think, there is no change in C++17
that justifies Clang behavior in rejecting the MWE in C++17.

This bug may also be related to this bug:
<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - template non-type with decltype(auto) placeholder does not work with template specialization when a reference is passed"
   href="show_bug.cgi?id=39373">https://bugs.llvm.org/show_bug.cgi?id=39373</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>