public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/29136]  New: using declaration misinterpreted in classes
@ 2006-09-19  9:26 andrew dot stubbs at st dot com
  2006-09-19  9:42 ` [Bug c++/29136] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: andrew dot stubbs at st dot com @ 2006-09-19  9:26 UTC (permalink / raw)
  To: gcc-bugs

The following program should return 1 when executed:

struct A {
  virtual int f() {return 1;}
};

struct B : virtual A {
  virtual int f() {return 0;}
};

struct C : B , virtual A {
  using A::f;
};

int
main () {
  C c;
  return c.f () + c.C::f ();
}

It actually returns 2.

The C++ standard section 10.3 shows the example which somewhat matches the code
above. The 'c.f()' is supposed to call 'B::f' and the 'c.C::f()' is supposed
to call 'A::f'. In fact, both call 'A::f'.


-- 
           Summary: using declaration misinterpreted in classes
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: andrew dot stubbs at st dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29136


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

* [Bug c++/29136] using declaration misinterpreted in classes
  2006-09-19  9:26 [Bug c++/29136] New: using declaration misinterpreted in classes andrew dot stubbs at st dot com
@ 2006-09-19  9:42 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-19  9:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-09-19 09:41 -------
This is a dup of bug 11750, it was not hard to find that bug.
Anyways the problem here is that we still use mostly the old ARM style using
semantics instead of the standard defined ones.

*** This bug has been marked as a duplicate of 11750 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29136


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

end of thread, other threads:[~2006-09-19  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-19  9:26 [Bug c++/29136] New: using declaration misinterpreted in classes andrew dot stubbs at st dot com
2006-09-19  9:42 ` [Bug c++/29136] " pinskia at gcc dot gnu dot org

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