This documentation is archived and is not being maintained.

Compiler Warning (level 4) C4516

Error Message

'class::symbol' : access-declarations are deprecated; member using-declarations provide a better alternative

The ANSI C++ committee has declared access declarations (changing the access of a member in a derived class without the using keyword) to be outdated. Access declarations may not be supported by future versions of C++.

The following sample generates C4516:

// C4516.cpp
// compile with: /W4
class A
   void x(char);

class B : protected A
   A::x;  // C4516 on access-declaration
   // use the following line instead
   // using A::x; // using-declaration, ok

int main()