public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/10761: [3.4] wrong virtual function called
@ 2003-05-13  5:36 Dara Hazeghi
  0 siblings, 0 replies; 2+ messages in thread
From: Dara Hazeghi @ 2003-05-13  5:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/10761; it has been noted by GNATS.

From: Dara Hazeghi <dhazeghi@yahoo.com>
To: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org, snyder@fnal.gov
Cc:  
Subject: Re: c++/10761: [3.4] wrong virtual function called
Date: Mon, 12 May 2003 22:26:00 -0700

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit- 
 trail&database=gcc&pr=10761
 
 Hello,
 
 I can confirm that this testcase worked on 3.2 and 3.3 branch, but  
 fails on mainline (20030512), making it a regression.
 
 Dara
 


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

* c++/10761: [3.4] wrong virtual function called
@ 2003-05-12 23:16 snyder
  0 siblings, 0 replies; 2+ messages in thread
From: snyder @ 2003-05-12 23:16 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10761
>Category:       c++
>Synopsis:       [3.4] wrong virtual function called
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Mon May 12 23:16:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     scott snyder
>Release:        3.4 20030512 (experimental)
>Organization:
<organization of PR author (multiple lines)>
>Environment:
System: Linux karma 2.4.19-emp_2419p5a829i #1 Tue Sep 3 17:42:17 EST 2002 i686 i686 i386 GNU/Linux
Architecture: i686

	<machine, os, target, libraries (multiple lines)>
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --prefix=/usr/local/gcc --enable-threads=posix --enable-long-long --enable-languages=c,c++,f77 : (reconfigured) 
>Description:

Another case where we call the derived-class version of a virtual function,
in the face of an explicit request to call the version in the
base class.

The example below goes into an infinite recursive loop:

$ g++ -o x x.cc
$ ./x
B::foo
B::foo
B::foo
B::foo
B::foo
...


>How-To-Repeat:

---------------------------------------------
extern "C" int printf(...);

class A
{
public:
  virtual ~A () {}
  virtual void foo () { printf ("A::foo\n"); }
};

template <class T>
class B
  : public A
{
public:
  virtual void foo () {
    printf ("B::foo\n");
    this->A::foo ();
  }
};

int main ()
{
  B<int> b;
  b.foo();
  return 0;
}
---------------------------------------------

>Fix:
	<how to correct or work around the problem, if known (multiple lines)>
>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2003-05-13  5:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-13  5:36 c++/10761: [3.4] wrong virtual function called Dara Hazeghi
  -- strict thread matches above, loose matches on Subject: below --
2003-05-12 23:16 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).