Skip to content

Commit c288700

Browse files
authored
Merge pull request #2251 from corob-msft/cr-C4596
Create error C4596 article, links, and TOC entry
2 parents 4aae916 + bb9b292 commit c288700

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: "Compiler Warning (Level 4) C4596"
3+
ms.date: "08/15/2019"
4+
f1_keywords: ["C4596"]
5+
helpviewer_keywords: ["C4596"]
6+
---
7+
# Compiler Warning (level 4) C4596
8+
9+
> '*name*': illegal qualified name in member declaration
10+
11+
## Remarks
12+
13+
A member declaration has an unexpected qualification. To resolve this warning, remove the qualification from the identifier.
14+
15+
This warning is off by default. You can use [/Wall](../../build/reference/compiler-option-warning-level.md) or __/w__*N*__4596__ to enable it on the command line as a level *N* warning. Or, use [#pragma warning](../../preprocessor/warning.md)(*N*:4596) in your source file. For more information, see [Compiler warnings that are off by default](../../preprocessor/compiler-warnings-that-are-off-by-default.md). Some versions of the compiler only generate this warning under [/permissive-](../../build/reference/permissive-standards-conformance.md).
16+
17+
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](compiler-warnings-by-compiler-version.md).
18+
19+
## Example
20+
21+
This sample generates C4596, and shows a way to fix it:
22+
23+
```cpp
24+
// C4596.cpp
25+
// compile with: /w14596 /c
26+
27+
struct A {
28+
void A::f() { } // error C4596: illegal qualified name in member
29+
// declaration.
30+
// Remove redundant 'A::' to fix.
31+
};
32+
```

docs/error-messages/compiler-warnings/compiler-warnings-c4400-through-c4599.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ The articles in this section of the documentation explain a subset of the warnin
185185
|Compiler warning (level 1) C4593|'*function*': 'constexpr' call evaluation step limit of '*limit*' exceeded; use /constexpr:steps\<NUMBER> to increase the limit|
186186
|Compiler warning (level 3) C4594|'*type*': destructor will not be implicitly called if an exception is thrown|
187187
|Compiler warning (level 1) C4595|'*type*': behavior change: destructor will no longer be implicitly called if an exception is thrown|
188-
|Compiler warning (level 4) C4596|'*identifier*': illegal qualified name in member declaration|
188+
|[Compiler warning (level 4) C4596](../../error-messages/compiler-warnings/c4596.md)|'*identifier*': illegal qualified name in member declaration|
189189
|Compiler warning (error) C4597|undefined behavior: offsetof applied to a member of a virtual base|
190190
|Compiler warning (level 1 and level 3) C4598|'#include "*header*"': header number *number* in the precompiled header does not match current compilation at that position|
191191
|Compiler warning (level 3) C4599|'*flag* *path*': command line argument number *number* does not match precompiled header|

docs/error-messages/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3858,6 +3858,8 @@
38583858
href: compiler-warnings/compiler-warning-level-1-c4581.md
38593859
- name: Compiler warning (level 1) C4584
38603860
href: compiler-warnings/compiler-warning-level-1-c4584.md
3861+
- name: Compiler warning (level 4) C4596
3862+
href: compiler-warnings/c4596.md
38613863
- name: Compiler warnings C4600 Through C4799
38623864
expanded: false
38633865
items:

docs/preprocessor/compiler-warnings-that-are-off-by-default.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ The following warnings are turned off by default in Visual Studio 2015 and later
8080
|C4583 (level 4)|'*type*': destructor is not implicitly called|
8181
|C4587 (level 1)|'*anonymous_structure*': behavior change: constructor is no longer implicitly called|
8282
|C4588 (level 1)|'*anonymous_structure*': behavior change: destructor is no longer implicitly called|
83-
|C4596 (level 4)|'*identifier*': illegal qualified name in member declaration <sup>14.3</sup> <sup>Perm</sup>|
83+
|[C4596](../error-messages/compiler-warnings/c4596.md) (level 4)|'*identifier*': illegal qualified name in member declaration <sup>14.3</sup> <sup>Perm</sup>|
8484
|C4598 (level 1 and level 3)|'#include "*header*"': header number *number* in the precompiled header does not match current compilation at that position <sup>14.3</sup>|
8585
|C4599 (level 3)|'*option* *path*': command-line argument number *number* does not match pre-compiled header <sup>14.3</sup>|
8686
|C4605 (level 1)|'/D*macro*' specified on current command line, but was not specified when precompiled header was built|

0 commit comments

Comments
 (0)