https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122029
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note a simple change to the constructor of C helps:
C(const Func_t &func) : m_func2(func) {}
It looks like there are missed optimization here ...
