http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50986

--- Comment #2 from Richard Smith <richard-gccbugzilla at metafoo dot co.uk> 
2012-02-01 21:14:35 UTC ---
As noted in comment#0, I believe there is no ODR violation here. Each
definition of U<S>::k consists of the same sequence of tokens, every name
refers to the same entity in both definitions, and none of the other provisions
of [basic.def.odr]p5 applies.

After some discussion, the proposed approach in clang is (roughly) to always
generate a guard variable (initialized to 1 for a statically-initialized
variable), and to put the variable and its guard variable in the same COMDAT
group. Full details are in this thread:

http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-November/018816.html

Reply via email to