<html>
    <head>
      <base href="http://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 - SFINAE emits a substitution error even though it shouldn't when checking an overload"
   href="http://bugs.llvm.org/show_bug.cgi?id=32179">32179</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SFINAE emits a substitution error even though it shouldn't when checking an overload
          </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>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>arphaman@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18065" name="attach_18065" title="The test file that reproduces the problem">attachment 18065</a> <a href="attachment.cgi?id=18065&action=edit" title="The test file that reproduces the problem">[details]</a></span>
The test file that reproduces the problem

Clang trunk emits a substitution error when checking if a particular overload
of 'invoke' can be selected:

test.cpp:135:50: error: type 'decay_t<double>' (aka 'double') cannot be used
prior to '::' because it has no members
  using functor_type = function_traits<decltype(&decay_t<F>::operator())>;
                                                 ^
test.cpp:184:25: note: in instantiation of template class
'function_traits<double>' requested here
    make_index_sequence<function_traits<Functor>::arity> { }))>
                        ^
test.cpp:224:29: note: while substituting deduced template arguments into
function template 'invoke' [with Functor = double, Runpackable = double]
  constexpr double result = invoke(test { }, 0.5, 2.5);


Even though we get this SFINAE error, Clang still selects the correct version
of 'invoke' (verified by AST inspection and static assert check).

GCC compiles the test file successfully.</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>