Article ID: 167356
Article Last Modified on 10/17/2003
using B::f using B::g using B::xwith one:
using namespace B;Please see the MORE INFORMATION section for a sample that demonstrates the workaround.
If the set of declarations and using-declarations for a single name are given in a declarative region, --they shall all refer to the same, or all refer to functions; or --exactly one declaration shall declare a class name or enumeration name and the other declarations shall all refer to the same entity or all refer to functions; in this case the class name or enumeration name is hidden.
namespace A {
int x;
}
namespace B {
int i;
struct g { };
struct x { };
void f(int);
void f(double);
void g(char);
}
void func() {
int i;
void f(char);
using B::f;
f(3.5f);
using B::g;
g('a');
struct g g1; // error C2079
using B::x;
using A::x; // error C2875
x = 99; // error C2513:
struct x x1;
}
//Workaround
namespace A {
int x;
}
namespace B {
int i;
struct g { };
struct x { };
void f(int);
void f(double);
void g(char);
}
void func() {
using namespace B ;
int i;
void f(char);
f(3.5f);
g('a');
struct g g1;
using A::x;
x = 99;
struct x x1;
}
Keywords: kbbug kbfix kbvc600fix KB167356