https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112590
--- Comment #3 from Janez Zemva <janezz55 at gmail dot com> --- Sorry for my last comment. I have prepared a more involved example: https://github.com/user1095108/ca/blob/master/consttests.cpp If test<a>(); is commented out, everything compiles, otherwise not.