This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/8577: postfix operator not inherithed
- From: Delana dot Lorenzo at libero dot it
- To: gcc-gnats at gcc dot gnu dot org
- Date: 14 Nov 2002 06:45:54 -0000
- Subject: c++/8577: postfix operator not inherithed
- Reply-to: Delana dot Lorenzo at libero dot it
>Number: 8577
>Category: c++
>Synopsis: postfix operator not inherithed
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Nov 13 22:46:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Delana.Lorenzo@libero.it
>Release: gcc-3.2
>Organization:
>Environment:
Linux
>Description:
#include <iostream>
using namespace std;
class A
{
public:
virtual void toimplement () = 0;
void implemented () { toimplement(); }
virtual void operator ++ () = 0;
void operator ++ (int) { printf ("Postfix inc\n"); }
};
class B : public A {
public:
void toimplement () { printf ("IMPLEMENTATION of pure\n"); }
void operator ++ () { printf ("Prefix inc\n"); }
};
int
main ()
{
B b;
b.implemented ();
++b;
b++; // b not inherit the implemented A baseclass level postfix operator
}
>How-To-Repeat:
compile simple source code
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: