<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 - clang rejects valid code for error: no viable constructor or deduction guide for deduction"
   href="https://bugs.llvm.org/show_bug.cgi?id=47352">47352</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang rejects valid code for error: no viable constructor or deduction guide for deduction
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>enhancement
          </td>
        </tr>

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

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

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

        <tr>
          <th>Reporter</th>
          <td>tangyixuan@mail.dlut.edu.cn
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>g++ compiles the code successfully, while clang++ rejects it.

$ cat s.cpp
template < int I > struct int_{};

template < typename T >
struct A{
    template < typename U, int I >
    struct B{
        B(U u, int_< I >){}
    };
};


int main(){
    A< int >::B v(0, int_< 0 >());
    (void)v;
}


$ clang -v
clang version 11.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
ab4627364aefcaac751e757b721b7d07b48a545a)
Target: x86_64-unknown-linux-gnu
Thread model: posix

$ clang++ -c s.cpp
s.cpp:13:17: error: no viable constructor or deduction guide for deduction of
template arguments of 'B'
    A< int >::B v(0, int_< 0 >());
                ^
s.cpp:6:12: note: candidate function template not viable: requires 1 argument,
but 2 were provided
    struct B{
           ^
s.cpp:6:12: note: candidate function template not viable: requires 0 arguments,
but 2 were provided
1 error generated.</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>