This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/1771: Very strange using/const bug



>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:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]