https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99686
--- Comment #6 from Steven Sun <StevenSun2021 at hotmail dot com> --- While in C++20, the complier thinks it's unnecessary to instatiate a new template. Just use the full specialization! Thus, this bug wouldn't exist at first place. Intuitively, I am in favor of the compiler's C++20 behavior -- use full specialization anyway. Clang 12 and MSVC latest also have this behavior (choose full specialization). I don't know how to contribute to gcc. If anyone would like to fix this bug, my recommendation would be: Make the compiler in C++17 mode think it's unnecessary to instantiate a new function when full specialzation is provided, which resulting the same behavior as C++20 mode and as other compilers.