public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/2398: external name gets put in wrong namespace
@ 2001-04-01  0:00 snyder
  0 siblings, 0 replies; only message in thread
From: snyder @ 2001-04-01  0:00 UTC (permalink / raw)
  To: gcc-gnats

>Number:         2398
>Category:       c++
>Synopsis:       external name gets put in wrong namespace
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 26 21:46:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     scott snyder
>Release:        3.0 20010326 (prerelease)
>Organization:
>Environment:
System: Linux karma 2.2.16-22 #1 Tue Aug 22 16:49:06 EDT 2000 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../egcs/configure --prefix=/usr/local/egcs --enable-threads=posix --enable-long-long
>Description:

If i compile the source below and look at the generated code, i see
that the reference to the rcp::EntryRCPID constructor is said to be
in the global namespace, _not_ the rcp namespace.

If the typedef is removed, then the external reference moves back
to the rcp namespace.  Oddly, if the EntryRCPID class is made non-virtual
by removing the destructor declaration, and if i turn on debugging,
then the external name also moves back to the rcp namespace.

>How-To-Repeat:

---------------------------------------------------------------------
namespace rcp {

struct EntryRCPID
{
  EntryRCPID();
  virtual ~EntryRCPID();
};

typedef EntryRCPID                  EntryRCPID;

}

void xyzzy()
{
  rcp::EntryRCPID x;
}

---------------------------------------------------------------------


$ ./cc1plus -quiet x.cc
$ c++filt < x.s | grep EntryRCPID
        call    EntryRCPID::EntryRCPID()
        call    EntryRCPID::~EntryRCPID()

If i comment out the destructor declaration in the above and add -g
to the compilation, i get instead the following results:

$ ./cc1plus -g -quiet x.cc
$ c++filt  < x.s | grep EntryRCPID
        .stabs  "EntryRCPID:T(0,25)=s1operator=::(0,26)=#(0,25),(0,27)=&(0,25),(0,28)=*(0,25),(0,29)=&(0,25),(0,21);:rcp::EntryRCPID::operator=(rcp::EntryRCPID const&);2A.;__base_ctor::(0,30)=#(0,25),(0,21),(0,28),(0,29),(0,21);:rcp::EntryRCPID::EntryRCPID(rcp::EntryRCPID const&);2A.;__comp_ctor::(0,30):rcp::EntryRCPID::EntryRCPID(rcp::EntryRCPID const&);2A.;__base_ctor::(0,31)=#(0,25),(0,21),(0,28),(0,21);:rcp::EntryRCPID::EntryRCPID();2A.;__comp_ctor::(0,31):rcp::EntryRCPID::EntryRCPID();2A.;;",128,0,0,0
        .stabs  "EntryRCPID:Tt(0,25)",128,0,4,0
        call    rcp::EntryRCPID::EntryRCPID()


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


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

only message in thread, other threads:[~2001-04-01  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-01  0:00 c++/2398: external name gets put in wrong namespace snyder

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).