Edit

Share via


Compiler Error C2868

'identifier' : illegal syntax for using-declaration; expected qualified-name

A using declaration requires a qualified name, a scope-operator (::) separated sequence of namespace, class, or enumeration names that ends with the identifier name. A single scope resolution operator may be used to introduce a name from the global namespace.

Example

The following sample generates C2868 and also shows correct usage:

// C2868.cpp
class X {
public:
   int i;
};

class Y : X {
public:
   using X::i;   // OK
};

int main() {
   using X;   // C2868
}