This is the mail archive of the
mailing list for the GCC project.
Re: enforce [basic.link] for static variables
On Mon, 08 Mar 2004 13:46:17 -0800, Mark Mitchell <firstname.lastname@example.org> wrote:
> Geoffrey Keating wrote:
>>C++ doesn't allow variables with static linkage to have a type that
>>doesn't have linkage, and it's a mandatory diagnostic.
We discussed this at the last two C++ meetings:
> I think we should adjust this patch just to issue an error. That goes for
> functions too. (I understand that you were just mimicing the existing
I disagree, I think a pedwarn is the right answer.
> The reason is that otherwise we'll do distinctly odd things during
> name-mangling, and -- I believe -- generate possible link-time failures
> that make no sense to people, or, worse yet, combine distinct variables at
Entities with internal linkage don't usually affect link-time behavior.
The resolution of the issue above prevents these non-names from leaking out
into template instantiations.