https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95686
--- Comment #2 from Lénárd Szolnoki <leni536 at gmail dot com> --- I failed to mention that I compiled the example in -std=c++17. With this compiler option it compiles but fails to link in gcc. It compiles, links and runs as expected in clang. The linkage requirement for reference/pointer non-type template arguments were lifted in C++17.