https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121611
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- With the trunk or with -fchecking we get the following ICE: <source>: In function 'int main()': <source>:19:22: internal compiler error: canonical types differ for identical types 'int(SomeClass*)' and 'int(SomeClass*)' 19 | func_ptr_template(func_1); // ERROR: template deduction fails | ~~~~~~~~~~~~~~~~~^~~~~~~~