Yes this is undefined behavior. After the closing brace of the constructor callable is destroyed and you have a dangling pointer.

The reason you are not seeing adverse effects is that you really aren't using the instance after it goes out of scope. The function call operator is stateless so it is not trying to access the memory that it no longer owns.