This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/1771: Very strange using/const bug
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/1771: Very strange using/const bug
- From: hyrosen at mail dot com
- Date: 25 Jan 2001 18:22:39 -0000
- Reply-To: hyrosen at mail dot com
>Number: 1771
>Category: c++
>Synopsis: Very strange using/const bug
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Thu Jan 25 10:26:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Hyman Rosen
>Release: gcc version 2.97 20010124 (experimental)
>Organization:
>Environment:
>Description:
The following code prints "const, not const, ".
The correct result should be "not const, not const, ".
#include <iostream>
struct B {
void a() { std::cout << "not const, "; }
void a() const { std::cout << "const, "; }
};
struct D1 : private B { D1() { a(); } using B::a; };
struct D2 : private B { D2() { a(); } };
int main() { D1 d1; D2 d2; }
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: