This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Private virtual function overridden as public compiles and runs (bug?)
- From: Georger Araujo <georger dot araujo at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 14 Oct 2013 20:30:56 -0300
- Subject: Re: Private virtual function overridden as public compiles and runs (bug?)
- Authentication-results: sourceware.org; auth=none
- References: <CAL_chLwsLyqU5fM82U24E-SAv0a1N+2-VDPvBsqFfWOgV=b_wg at mail dot gmail dot com> <525BA800 dot 4010105 at redhat dot com>
2013/10/14 Florian Weimer <fweimer@redhat.com>:
> On 10/14/2013 05:30 AM, Georger Araujo wrote:
>>
>> The following program compiles and runs - is it correct behavior? I
>> read §11.5 in the January 2012 working draft but couldn't reach a
>> conclusion.
>
>
> Yes, it is the correct behavior according to the C++ standard. I think it's
> broken, but as it's in the standard, there's little we can do about it.
>
> Do we issue a warning? We proably should.
I agree. Despite being correct behavior, it allows for a weird
(risky?) change to an interface and probably indicates a mistake.
Georger