Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

An access issue -- programming on auto-pilot...

0 views
Skip to first unread message

Alf P. Steinbach

unread,
Aug 29, 2009, 2:40:52 AM8/29/09
to
Since others' errors can be enlightening, here's one of mine.

Without really thinking, apparently on complete auto-pilot, I'd written code
equivalent to

class Base
{
protected:
class Interface {};
};

class Derived
: public Base
, protected Base::Interface
{
};

int main()
{
}

This actually compiles with MSVC 7.1! :-(


Cheers & hth.,

- Alf

Fraser Ross

unread,
Aug 29, 2009, 8:49:26 AM8/29/09
to
"Alf P. Steinbach"

It should compile. Comeau has a bug. Did you compare it to Comeau?
Look at clause 11/6 and 7. The example is almost the same. It says
"Similarly, the use of A::B
as a base-specifier is well-formed because D is derived from A, so
checking of base-specifiers must be deferred until the entire
base-specifier-list has been seen.".


Fraser.


Alf P. Steinbach

unread,
Aug 29, 2009, 3:23:43 PM8/29/09
to
* Fraser Ross:

> "Alf P. Steinbach"
>> Since others' errors can be enlightening, here's one of mine.
>>
>> Without really thinking, apparently on complete auto-pilot, I'd
>> written code equivalent to
>>
>> class Base
>> {
>> protected:
>> class Interface {};
>> };
>>
>> class Derived
>> : public Base
>> , protected Base::Interface
>> {
>> };
>>
>> int main()
>> {
>> }
>>
>> This actually compiles with MSVC 7.1! :-(
>>
>>
>> Cheers & hth.,
>>
>> - Alf
>
> It should compile. Comeau has a bug. Did you compare it to Comeau?

Yes.


Comeau C/C++ 4.3.10.1 (Oct 6 2008 11:28:09) for ONLINE_EVALUATION_BETA2
Copyright 1988-2008 Comeau Computing. All rights reserved.
MODE:strict errors C++ C++0x_extensions

"ComeauTest.c", line 10: error: class "Base::Interface" (declared at line 5) is
inaccessible
, protected Base::Interface
^

1 error detected in the compilation of "ComeauTest.c".


> Look at clause 11/6 and 7. The example is almost the same. It says
> "Similarly, the use of A::B
> as a base-specifier is well-formed because D is derived from A, so
> checking of base-specifiers must be deferred until the entire
> base-specifier-list has been seen.".

Heh, I'm better on auto-pilot than the darned compilers! ;-)

Thanks, I thought it was the code that was incorrect.


Cheers,

- Alf

Fraser Ross

unread,
Aug 30, 2009, 5:25:54 AM8/30/09
to
Comeau follows the 2003 standard and thats why it reports an error. I
was looking at the latest draft.

Fraser.


0 new messages