<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 - Instantiation error when using SFINAE inside a class"
   href="https://bugs.llvm.org/show_bug.cgi?id=49804">49804</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Instantiation error when using SFINAE inside a class
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </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>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>denis@math.univ-lyon1.fr
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When trying to use SFINAE to detect templated method, Clang triggers an
instantiation error on the expression that should invalidate the templated
helper overload, the helper being declared inside another class. When the
helper is declared in the current namespace directly, the code compiles and
works fine.

Here is a (almost) minimal code: <a href="https://godbolt.org/z/7jEf3xdj5">https://godbolt.org/z/7jEf3xdj5</a>

I expected this code to output "0" four times (detection failed) with this
snippet, and "1" four times if `DTEMPLATED` is defined (de-commenting line 5).

Clang (11, 10, trunk, ...) triggers an error during instantiation when using
`Test1` (helper wrapped inside a class): "no matching member function for call
to 'd'" or "no matching member function for call to 'd'" depending on the
tested class (`Dummy1` or `Dummy2`).

It works when using `Test2` instead, that is almost the same code but without
wrapping class.

I think it is a bug because of the successful compilation for Test2 and since
it works with GCC.</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>