<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 - Type mismatch for pointer to template template function"
   href="https://bugs.llvm.org/show_bug.cgi?id=49079">49079</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Type mismatch for pointer to template template function
          </td>
        </tr>

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

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

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

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

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

        <tr>
          <th>Reporter</th>
          <td>pavel.kryukov@phystech.edu
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If a function is a template template function (template<template<typename>
class> void foo(int&)), and a template template parameter has a default value,
it does not fit to function pointer type.

Example:

<span class="quote">> template<typename, typename = int> class A { };

> template<template<typename> class> void foo(int&);
> void bar(void(*)(int&));

> int main()
> {
>     bar(foo<A>);
> }</span >
Output:

<span class="quote">> <source>:8:5: error: no matching function for call to 'bar'
>     bar(foo<A>);
>     ^~~
> <source>:4:6: note: candidate function not viable:
>   no overload of 'foo' matching 'void (*)(int &)' for 1st argument
> void bar(void(*)(int&));</span >
Godbolt: <a href="https://godbolt.org/z/enhYs8">https://godbolt.org/z/enhYs8</a>

With GCC and MSVC, example compiles fine.</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>