F
Fernando Cacciola
Hi people,
I'm testing
Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
with our code base.
I'm getting lots of errors on code that compiled fine in 7.1.
Most of it boils down to the following new compiler bug:
struct A
{
int foo() const { return 1; }
};
struct B : A
{
typedef A base ;
};
struct D : B
{
} ;
int main(int argc, char* argv[])
{
B b ;
D d ;
int r0 = b.base::foo();
int r1 = d.base::foo(); // error C2039: 'A' : is not a member of 'D'
return 0;
}
As you can see, vc8 can't see the type B::base, which is A, from D.
Worst.. I get the same error even if D is defined as:
struct D : B
{
typedef B::base base ;
} ;
which explicitely redeclares B::base within D
I can of course do something like
struct D : B
{
typedef B Base ;
} ;
and then change the client code from
d.base::foo()
to
d.Base::base::foo()
which compiles OK, but I'd really hate to need to refactor ALL client code..
any ideas?
TIA
I'm testing
Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
with our code base.
I'm getting lots of errors on code that compiled fine in 7.1.
Most of it boils down to the following new compiler bug:
struct A
{
int foo() const { return 1; }
};
struct B : A
{
typedef A base ;
};
struct D : B
{
} ;
int main(int argc, char* argv[])
{
B b ;
D d ;
int r0 = b.base::foo();
int r1 = d.base::foo(); // error C2039: 'A' : is not a member of 'D'
return 0;
}
As you can see, vc8 can't see the type B::base, which is A, from D.
Worst.. I get the same error even if D is defined as:
struct D : B
{
typedef B::base base ;
} ;
which explicitely redeclares B::base within D
I can of course do something like
struct D : B
{
typedef B Base ;
} ;
and then change the client code from
d.base::foo()
to
d.Base::base::foo()
which compiles OK, but I'd really hate to need to refactor ALL client code..
any ideas?
TIA