Redigera

Dela via


Compiler Warning (level 4) C4596

'name': illegal qualified name in member declaration

Remarks

A member declaration has an unexpected qualification. To resolve this warning, remove the qualification from the identifier.

This warning is off by default. You can use /Wall or /wN4596 to enable it on the command line as a level N warning. Or, use #pragma warning(N:4596) in your source file. For more information, see Compiler warnings that are off by default. Some versions of the compiler only generate this warning under /permissive-.

This warning is available starting in Visual Studio 2015 Update 3. Code that compiled without warnings in earlier versions of the compiler can now generate C4596. For information on how to disable warnings introduced in a particular compiler version or later, see Compiler Warnings by compiler version.

Example

This sample generates C4596, and shows a way to fix it:

// C4596.cpp
// compile with: /w14596 /c

struct A {
    void A::f() { } // error C4596: illegal qualified name in member
                    // declaration.
                    // Remove redundant 'A::' to fix.
};