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

bikineev at google dot com gcc-bugzilla@gcc.gnu.org
Thu Mar 26 17:17:21 GMT 2020


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

--- Comment #5 from Anton <bikineev at google dot com> ---
Looking at the COMDAT groups for the example with 2 instantiations (Index<int>
and Index<float>), I think this is what is actually expected: section for
Index<int> must not be grouped with section for Index<float>. In general,
different instantiations must be kept in different COMDAT groups. Otherwise, it
would not work e.g. if one TU instantiates Index<int>, the other TU
instantiates Index<int> and Index<float>.


More information about the Gcc-bugs mailing list