https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58624
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |6.0 Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #18 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Jason Merrill from comment #8) > (In reply to Markus Trippelsdorf from comment #7) > > static __typeof 0 a __attribute__ ((__weakref__ (""))); > > template <typename> class A > > { > > static __thread int b; > > }; > > The problem with this testcase is that set_decl_tls_model adds A<T>::b, an > uninstantiated template, to the symbol table. This ICE was introduced by > honza's r211689. > > I'll deal with the other testcase. which seems like was fixed with r6-1888: @@ -2523,8 +2523,12 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) } if (VAR_P (newdecl) - && DECL_THREAD_LOCAL_P (newdecl)) - set_decl_tls_model (olddecl, DECL_TLS_MODEL (newdecl)); + && CP_DECL_THREAD_LOCAL_P (newdecl)) + { + CP_DECL_THREAD_LOCAL_P (olddecl) = true; + if (!processing_template_decl) + set_decl_tls_model (olddecl, DECL_TLS_MODEL (newdecl)); + } }