Closed as not planned
Description
This was previously compiling with c++17. It also works with libstdc++/c++20 and msvc/c++20.
#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.