This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: More test results...
>>>>> "Gabriel" == Gabriel Dos Reis <gdr@codesourcery.com> writes:
> Jason Merrill <jason@redhat.com> writes:
> | >>>>> "Gabriel" == Gabriel Dos Reis <gdr@codesourcery.com> writes:
> |
> | > While your example is well-formed, I don't think it scales to
> | > numeric_limits<>. Here is why: The standard doesn't say whether
> | > numeric_limits<> is exported or not. In case an implementation
> | > exported it, explicitly specializing individual members may violate
> | > the ODR. Therefore, any program playing that games is inherently
> | > non-portable.
> |
> | What does export have to do with it? The standard requires that a
> | declaration of an explicit specialization be seen at any point of
> | instantiation.
> Even for explicit specialization of exported static data members?
Yes. Why would that make a difference?
14.7.3 Explicit specialization [temp.expl.spec]
6 If a template, a member template or the member of a class template is
explicitly specialized then that specialization shall be declared
before the first use of that specialization that would cause an
implicit instantiation to take place, in every translation unit in
which such a use occurs; no diagnostic is required.
Jason