https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119529 --- Comment #2 from Jesse Williamson <jesse at mind dot net> --- Changing the name of the free function to differ from the class member compiles, e.g.: friend void g<>(int);