https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83342
Haonan Chen <phychn at stu dot xmu.edu.cn> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |phychn at stu dot xmu.edu.cn --- Comment #3 from Haonan Chen <phychn at stu dot xmu.edu.cn> --- (In reply to Olivier Kannengieser from comment #2) > Whit gcc 8.2, there is no more bug for constant template variables. But > compilation produces undefined symbol error at linking phase if variables > templates are non const: > > template<class T> > extern T value4; > template<class T> > T value4= 0; > > auto test4 = value4<int>; //linking phase error: undefined symbol value4<int> > > template<class T> > extern T value5; > template<class T> > inline T value5=0; > > auto test5 = value5<int>; //linking phase error: undefined symbol value5<int> > > > There are no error with Clang. The bug is still there in gcc 10.1.0.