<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 --- - template parameter not deducible in partial specialization of template inside template"
   href="https://llvm.org/bugs/show_bug.cgi?id=31094">31094</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>template parameter not deducible in partial specialization of template inside template
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.9
          </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++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>akondrat@kcg.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The code below worked on clang 3.6, but warns on 3.8 and 3.9:

    template <typename T>
    struct outer
    {
        template <typename U>
        struct inner
        {

        };
    };


    template <typename T>
    struct is_inner_for
    {
        template <typename Whatever>
        struct predicate
        {
            static constexpr bool value = false;
        };

        template <typename U>
        struct predicate<typename outer<T>::template inner<U>>
        {
            static constexpr bool value = true;
        };
    };

    static_assert(
        is_inner_for<int>::template predicate<
            outer<int>::inner<double>
        >::value,
        "Yay!"
    );

Here is the warning:

    <source>:23:12: warning: class template partial specialization contains a
template parameter that cannot be deduced; this partial specialization will
never be used
    struct predicate<typename outer<T>::template inner<U>>
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    <source>:22:24: note: non-deducible template parameter 'U'
    template <typename U>
    ^
    1 warning generated.

Even though clang warns about the partial specialization not being used, the
code compiles fine and that specialization is in fact used.

GCC 6 bug that resulted in the same type of error:
<a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70141">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70141</a>

Godbolt output: <a href="https://godbolt.org/g/pqJcQu">https://godbolt.org/g/pqJcQu</a>

Stack overflow question:
<a href="http://stackoverflow.com/questions/35875829/template-parameters-not-deducible-in-partial-specialization-in-gcc6-for-a-case">http://stackoverflow.com/questions/35875829/template-parameters-not-deducible-in-partial-specialization-in-gcc6-for-a-case</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>