<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - SFNAE-based constructors error-out when accessed via constructor inheritance"
   href="https://llvm.org/bugs/show_bug.cgi?id=23461">23461</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SFNAE-based constructors error-out when accessed via constructor inheritance
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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++11
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>oneill+llvmbugs@cs.hmc.edu
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14304" name="attach_14304" title="Sample code that shows the failure in action.">attachment 14304</a> <a href="attachment.cgi?id=14304&action=edit" title="Sample code that shows the failure in action.">[details]</a></span>
Sample code that shows the failure in action.

If we compile the attached code, with

/some/where/llvm.236909/bin/clang++ -std=c++11 -o sfnae-fail sfnae-fail.cpp

we get:

/some/where/llvm.236909/bin/../include/c++/v1/random:1867:28: error: no type
      named 'type' in 'std::__1::enable_if<false, void>'; 'enable_if' cannot be
      used to disable this declaration
  ...enable_if<__is_seed_sequence<_Sseq,
linear_congruential_engine>::value>:...
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sfnae-fail.cpp:7:19: note: in instantiation of member function
      'std::__1::linear_congruential_engine<unsigned int, 48271, 0,
      2147483647>::linear_congruential_engine' requested here
    using Engine::Engine;               // Inherited constructor
                  ^
sfnae-fail.cpp:21:49: note: while substituting deduced template arguments into
      function template 'inherited' [with _Sseq = int]
    inherited<std::default_random_engine>       fails(0);
                                                ^
1 error generated.

The issue seems to be related to SFNAE not working when a constructor is
inherited. If we access the constructor directly (i.e., no through
inheritance), it works fine.  Similarly, if we comment out the SFNAE
constructor (which isn't even the one we want in this code), it compiles fine
with constructor inheritance.

The failure occurs on both trunk and 3.6 (and earlier).  GCC 5.1 and earlier
show no issue with the code.</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>