[Bug c++/94342] GCC ignores attribute((section(...))) for static variables inside templates

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 26 13:25:20 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94342

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think it should belong to the same .comdat group as other parts of the
template instantiation (there's one static var per instantiation) so I don't
see how the section specification can be easily honored.

But at least a diagnostic would be appropriate.

That is, consider two TUs with instantiations of Index<int>, how will you
make linking work?  Force the definition WEAK?


More information about the Gcc-bugs mailing list