Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-10-23 11:01:51


Here is a transcript of an exchange I had with Metrowerks' lead compiler
engineer:

I think that the error message is correct. The problem can be simplified to

namespace re_detail {

    struct c_traits_base {
    protected:
        static void do_lookup_collate();
    };

    struct c_regex_traits : c_traits_base {
        static void lookup_collatename();
    };

    void c_regex_traits::lookup_collatename()
    {
        re_detail::c_traits_base::do_lookup_collate();
    }

}

"re_detail::c_traits_base::do_lookup_collate();" is not legal because
"do_lookup_collate" is found by namespace access that is using a re_detail
namespace qualification.

The example will compile when you change the call to
"c_traits_base::do_lookup_collate();" so that the name is found in a base
class lookup.

Andreas

Support at qa_at_[hidden] wrote:

> namespace C {
> struct A {
> protected:
> static int m;
> };
> struct B : A {
> static int f();
> };
>
> int B::f()
> {
> return A::m;
> //return C::A::m;
> }
> }
>
>
> Attachment: (there is no attachment for this bug)
>
> A new bug has been added to the bug database, Reference No. IR0010-0025-1;
>
>
<http://bugbase.mtwk.sps.mot.com/bugs/FMPro?-db=bug%5fdb&-format=record_det
> ail.htm&-lay=web%20layout&-op=cn&il%5fuid=IR0010-0025-1&-find=>
>
> Submitted by: David Abrahams
> Flagged by: Henry Cheang
> Product: CW for Windows
> Category: Incorrect Operation
>
> ------------<Original message sent to support_at_[hidden] ®>-----------
> X-Sybari-Space: 00000000 00000000 00000000
> From: "David Abrahams" <abrahams_at_[hidden]>
> To: "Support" <qa_at_[hidden]>
> Subject: Re: Re IR0010-0025: mptp-cwpro-report] This can't be right, can
> it
> Date: Tue, 10 Oct 2000 13:30:13 -0400
> X-Priority: 3
>
> Yes, I realize that the member is protected, but as I recall it is being
> accessed from a publicly derived class, so the access should be allowed.
> Am
> I missing something here?
> -Dave


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk