public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/6402: Qualified reference to variable causes copy
@ 2002-04-22  1:46 wolfgang.bangerth
  0 siblings, 0 replies; 3+ messages in thread
From: wolfgang.bangerth @ 2002-04-22  1:46 UTC (permalink / raw)
  To: gcc-gnats; +Cc: wolfgang


>Number:         6402
>Category:       c++
>Synopsis:       Qualified reference to variable causes copy
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 22 01:46:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang Bangerth
>Release:        unknown-1.0
>Organization:
>Environment:
gcc 2.95, 3.1pre, 3.2 mainline
>Description:
The following snippet doesn't compiler, although I believe
it should. The copy operation is caused by me qualifying
the name of the member variable "t" with the name of the
base class. The original code came from an application
where the base class exists twice and a qualification is
actually necessary.

Regards
  Wolfgang

-----------------------code------------------------
struct T {
    T();
  private:
    T (const T&);
};

struct Base {
    T t;
};

struct Derived : public Base {
    void f() {
      const T &t_ref = Base::t;  // taking reference, not a copy!
    };
};

-----------------error message-----------------------
x.cc: In method `void Derived::f()':
x.cc:4: `T::T(const T &)' is private
x.cc:13: within this context
>How-To-Repeat:

>Fix:

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/6402: Qualified reference to variable causes copy
@ 2002-12-30 14:37 reichelt
  0 siblings, 0 replies; 3+ messages in thread
From: reichelt @ 2002-12-30 14:37 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, wolfgang.bangerth, wolfgang

Synopsis: Qualified reference to variable causes copy

State-Changed-From-To: analyzed->closed
State-Changed-By: reichelt
State-Changed-When: Mon Dec 30 14:37:36 2002
State-Changed-Why:
    Fixed in gcc 3.4 with the new parser.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6402


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/6402: Qualified reference to variable causes copy
@ 2002-09-15  5:10 nathan
  0 siblings, 0 replies; 3+ messages in thread
From: nathan @ 2002-09-15  5:10 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, wolfgang.bangerth, wolfgang

Synopsis: Qualified reference to variable causes copy

State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Sun Sep 15 05:10:49 2002
State-Changed-Why:
    confirmed

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6402


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-12-30 22:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-22  1:46 c++/6402: Qualified reference to variable causes copy wolfgang.bangerth
2002-09-15  5:10 nathan
2002-12-30 14:37 reichelt

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