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?
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.
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.