<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/78614>78614</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Template with make_shared started failing with c++20 and libc++
        </td>
    </tr>

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

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          brendandahl
      </td>
    </tr>
</table>

<pre>
    This was previously compiling with c++17. It also works with libstdc++/c++20 and msvc/c++20.

```cpp
#include <memory>

class Foo {
public:
    Foo(int i) {}
};

template<typename Callable>
void constructor(Callable callable) {}

int main() {
 // std::shared_ptr<Foo> (*)(int &&)
 constructor(&std::make_shared<Foo, int>);
}
```

Flags: `-stdlib=libc++ -std=c++20 main.cpp`

Error:

```
main.cpp:15:5: error: no matching function for call to 'constructor'
   15 | constructor(&std::make_shared<Foo, int>);
      | ^~~~~~~~~~~
main.cpp:9:6: note: candidate template ignored: couldn't infer template argument 'Callable'
    9 | void constructor(Callable callable) {
      |      ^
1 error generated.
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVEuP5CgM_jXOxepSAnkecqhHl7T3uY8IuBJ2CERAetSX_e2rPOrRM3NZbZRKIbA_f_ZnLELQvSVqoThBcUnEHAfn286TVcIqMZikc-qz_TbogD9FwMnTh3ZzMJ8o3Thpo22PP3UcUAI7ATtl1QH_iihMcPjT-R9hOzW6C1HtNsCu-4qlKKzCMXzI180DpBdIj_u3TLdXTtO-w7i20syKEPh5pNH5T-Dvr07SiBDw6hxCddq2prkzWgLfLRBxOQdWaxtRA2tW0-qyw1QX4KdXyEjjZEQk4Of4OZEVI-FZGCM6Q4_oH04rlM6G6GcZnQdW321Q3o1_DbV-Fxaj0BZYfTfYeAK7ArtiiGrhzo9hEJ7U9yl64OclA_6Oq9MRWLOnA6xc32bH-MoIWPlAG8UP-r5B7nDsjNrGJSPWPEvwIHtX45X71Yg-AD8ilOlbiMroDvjF6G5XFN_WeJen6kumh0XQr0Dv3jv_kOiPER-e_JgVwI_LD2n3Q-twFFEOS1veZiujdhZvzq_Fx-gQWPWlGNWjG7ICoTr__1Lh-ixQULz_83h-Y98AP5Yb56WpjiiFVVqJSHhvNdS9dWu4RcLZKAusiqjtjfzTSPh-HmlVvXo05Eti2Kxs_ktr_pLItij2Hs-2cmNPlryIpA5_FCpRLVcNb0RCbValRZkWLK-ToSVJomhqkupGZVYWXVPLjrqmFpTnaXdLdMtSlqdZVmdNlqf1QdY5a0ridUFFlYkM8pRGoc3BmI_x4Hyf6BBmaqu6zPLEiI5MWEcaY88mBMaWEefbxemtm_sAeWp0iOEJE3U01H67V3YdXS-yY4jCR1J4E79Pvn2WPQMmszftEOO0XI3tFvc6DnN3kG4Edl2i7n9vk3d_k4zArmsmAdh1TebfAAAA__9HT6bq">