public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/7683: compiling with -g creates multiple symbols of the same name
@ 2002-08-22 10:26 spamjunk
  0 siblings, 0 replies; only message in thread
From: spamjunk @ 2002-08-22 10:26 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7683
>Category:       c++
>Synopsis:       compiling with -g creates multiple symbols of the same name
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 22 09:46:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Rich
>Release:        unknown-1.0
>Organization:
>Environment:
djgpp
>Description:
// this code will create two symbols called "_x" will cause the linker to fail.

template<int I>
struct foo {
};

template<>
struct foo<1> {
    static const int& val()
    {
        static const int x = 1;
        return x;
    }
};

template<>
struct foo<2> {
    static const int& val()
    {
        static const int x = 2;
        return x;
    }
};

int main()
{
    int x;

    x = foo<1>::val();

    x = foo<2>::val();

    return 0;
}
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-08-22 16:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-22 10:26 c++/7683: compiling with -g creates multiple symbols of the same name spamjunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).