Skip to content

Commit 8eb2a84

Browse files
Merge pull request #6179 from MicrosoftDocs/main
Auto Publish – main to live - 2025-12-08 18:30 UTC
2 parents 574f4e4 + bf75a07 commit 8eb2a84

File tree

10 files changed

+159
-115
lines changed

10 files changed

+159
-115
lines changed
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Compiler Error C2014"
33
description: "Learn more about: Compiler Error C2014"
4-
ms.date: 11/04/2016
4+
ms.date: 08/25/2025
55
f1_keywords: ["C2014"]
66
helpviewer_keywords: ["C2014"]
77
---
@@ -11,22 +11,21 @@ helpviewer_keywords: ["C2014"]
1111
1212
## Remarks
1313

14-
The `#` sign of a preprocessor directive must be the first character on a line that is not white space.
14+
The `#` sign of a [preprocessor directive](../../preprocessor/preprocessor-directives.md) must be the first character on a line that is not white space. Ensure that the previous line doesn't contain a trailing escape.
1515

1616
## Example
1717

1818
The following example generates C2014:
1919

2020
```cpp
2121
// C2014.cpp
22-
int k; #include <stdio.h> // C2014
23-
```
22+
// compile with: /c
2423

25-
Possible resolution:
24+
int a; #define A // C2014
2625

27-
```cpp
28-
// C2014b.cpp
29-
// compile with: /c
30-
int k;
31-
#include <stdio.h>
26+
int b;\
27+
#define B // C2014
28+
29+
int c;
30+
#define C // OK
3231
```
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
11
---
22
title: "Compiler Error C2033"
33
description: "Learn more about: Compiler Error C2033"
4-
ms.date: 11/04/2016
4+
ms.date: 09/10/2025
55
f1_keywords: ["C2033"]
66
helpviewer_keywords: ["C2033"]
77
---
88
# Compiler Error C2033
99

10-
> 'identifier' : bit field cannot have indirection
10+
> '*identifier*': bit field cannot have indirection
1111
1212
## Remarks
1313

14-
The bit field was declared as a pointer, which is not allowed.
14+
Bit fields can't be declared as a pointer, reference, or array. For more information, see [C++ Bit Fields](../../cpp/cpp-bit-fields.md).
1515

1616
## Example
1717

1818
The following example generates C2033:
1919

2020
```cpp
2121
// C2033.cpp
22-
struct S {
23-
int *b : 1; // C2033
22+
// compile with: /c
23+
24+
struct S
25+
{
26+
int* ptr : 1; // C2033
27+
int arr[3] : 1; // C2033
2428
};
2529
```
2630

27-
Possible resolution:
31+
## See also
2832

29-
```cpp
30-
// C2033b.cpp
31-
// compile with: /c
32-
struct S {
33-
int b : 1;
34-
};
35-
```
33+
[Compiler Error C2531](../compiler-errors-2/compiler-error-c2531.md)
Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
11
---
22
title: "Compiler Error C2154"
33
description: "Learn more about: Compiler Error C2154"
4-
ms.date: 11/04/2016
4+
ms.date: 09/21/2025
55
f1_keywords: ["C2154"]
66
helpviewer_keywords: ["C2154"]
77
---
88
# Compiler Error C2154
99

10-
> 'type' : only enumeration type is allowed as an argument to compiler intrinsic type trait '__underlying_type'
10+
> '*type*': only enumeration type is allowed as an argument to compiler intrinsic type trait '__underlying_type'
1111
1212
## Remarks
1313

14-
You can only get the underlying type of an enumeration type.
14+
You can only get the underlying type of an [enumeration](../../cpp/enumerations-cpp.md) type.
1515

16-
For more information, see [Compiler Support for Type Traits](../../extensions/compiler-support-for-type-traits-cpp-component-extensions.md).
16+
## Example
17+
18+
The following example generates C2154:
19+
20+
```cpp
21+
// C2154.cpp
22+
// compile with: /c
23+
24+
struct S {};
25+
enum E {};
26+
enum class EC {};
27+
28+
__underlying_type(S) s; // C2154
29+
__underlying_type(int) i; // C2154
30+
__underlying_type(E) e; // OK
31+
__underlying_type(EC) ec; // OK
32+
```
33+
34+
## See also
35+
36+
[`underlying_type` class](../../standard-library/underlying-type-class.md)
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
title: "Compiler Error C2182"
33
description: "Learn more about: Compiler Error C2182"
4-
ms.date: 11/04/2016
4+
ms.date: 08/22/2025
55
f1_keywords: ["C2182"]
66
helpviewer_keywords: ["C2182"]
77
---
88
# Compiler Error C2182
99

10-
> 'identifier' : illegal use of type 'void'
10+
> '*identifier*': this use of 'void' is not valid
1111
1212
## Remarks
1313

14-
A variable is declared type **`void`**.
14+
You can't create a variable or array of type **`void`**. Only pointers to **`void`** are allowed.
1515

1616
## Example
1717

@@ -20,9 +20,9 @@ The following example generates C2182:
2020
```cpp
2121
// C2182.cpp
2222
// compile with: /c
23-
int main() {
24-
int i = 10;
25-
void &ir = i; // C2182 cannot have a reference to type void
26-
int &ir = i; // OK
27-
}
23+
24+
void var; // C2182
25+
void arr[5]; // C2182
26+
27+
void* ptr; // OK
2828
```
Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
---
22
title: "Compiler Error C2290"
33
description: "Learn more about: Compiler Error C2290"
4-
ms.date: 11/04/2016
4+
ms.date: 12/5/2025
55
f1_keywords: ["C2290"]
66
helpviewer_keywords: ["C2290"]
77
---
88
# Compiler Error C2290
99

10-
> C++ asm syntax ignored. Use __asm.
10+
> C++ 'asm' syntax ignored. Use __asm.
1111
1212
## Remarks
1313

14-
The **`asm`** syntax is reserved for future use.
14+
The **`asm`** syntax is reserved for future use. Try [`__asm`](../../assembler/inline/asm.md) instead. For more information, see [Inline Assembler](../../assembler/inline/inline-assembler.md).
15+
16+
## Example
17+
18+
The following example generates C2290:
19+
20+
```cpp
21+
// C2290.cpp
22+
// Compile for 32 bit, i.e. x86 instead of x64
23+
24+
int main()
25+
{
26+
asm("nop"); // C2290
27+
__asm { nop } // OK
28+
}
29+
```

docs/error-messages/compiler-errors-1/compiler-errors-c2100-through-c2199.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Compiler errors C2100 through C2199"
33
description: "Learn more about: Compiler errors C2100 through C2199"
4-
ms.date: "04/21/2019"
4+
ms.date: 04/21/2019
55
f1_keywords: ["C2119", "C2123", "C2125", "C2126", "C2127", "C2136", "C2176", "C2187", "C2189"]
66
helpviewer_keywords: ["C2119", "C2123", "C2125", "C2126", "C2127", "C2136", "C2176", "C2187", "C2189"]
77
---
@@ -69,7 +69,7 @@ The articles in this section of the documentation explain a subset of the error
6969
|[Compiler error C2151](compiler-error-c2151.md)|more than one language attribute|
7070
|[Compiler error C2152](compiler-error-c2152.md)|'*identifier*': pointers to functions with different attributes|
7171
|[Compiler error C2153](compiler-error-c2153.md)|integer literals must have at least one digit|
72-
|[Compiler error C2154](compiler-error-c2154.md)|'*type*': only enumeration type is allowed as an argument to compiler intrinsic type trait '*trait*'|
72+
|[Compiler error C2154](compiler-error-c2154.md)|'*type*': only enumeration type is allowed as an argument to compiler intrinsic type trait '__underlying_type'|
7373
|[Compiler error C2155](compiler-error-c2155.md)|'?': invalid left operand, expected arithmetic or pointer type|
7474
|[Compiler error C2156](compiler-error-c2156.md)|pragma must be outside function|
7575
|[Compiler error C2157](compiler-error-c2157.md)|'*identifier*': must be declared before use in pragma list|
@@ -97,7 +97,7 @@ The articles in this section of the documentation explain a subset of the error
9797
|[Compiler error C2179](compiler-error-c2179.md)|'*type*': an attribute argument cannot use type parameters|
9898
|[Compiler error C2180](compiler-error-c2180.md)|controlling expression has type '*type*'|
9999
|[Compiler error C2181](compiler-error-c2181.md)|illegal else without matching if|
100-
|[Compiler error C2182](compiler-error-c2182.md)|'*identifier*': illegal use of type 'void'|
100+
|[Compiler error C2182](compiler-error-c2182.md)|'*identifier*': this use of 'void' is not valid|
101101
|[Compiler error C2183](compiler-error-c2183.md)|syntax error: translation unit is empty|
102102
|[Compiler error C2184](compiler-error-c2184.md)|'*type*': illegal type for __except expression|
103103
|[Compiler error C2185](compiler-error-c2185.md)|'*identifier*': illegal based allocation|

docs/error-messages/compiler-warnings/compiler-warning-c5072.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Compiler Warning (level 1) C5072"
33
description: "Learn more about: Compiler Warning (level 1) C5072"
4-
ms.date: 02/09/2024
4+
ms.date: 09/10/2025
55
f1_keywords: ["C5072"]
66
helpviewer_keywords: ["C5072"]
77
---
@@ -15,13 +15,17 @@ This warning occurs when you compile with [Address Sanitizer](../../sanitizers/a
1515

1616
## Example
1717

18-
The following command line generates warning `C5072`:
18+
The following command line generates warning C5072:
1919

20-
```cpp
21-
cl /fsanitize=address /EHsc test.cpp
20+
```cmd
21+
cl /fsanitize=address /EHsc test.cpp
2222
```
2323

24-
To fix it, have the compiler generate debug information by using a switch like [`/Zi`](../../build/reference/z7-zi-zi-debug-information-format.md#zi) or [`/Z7`](../../build/reference/z7-zi-zi-debug-information-format.md#z7), like this: `cl /fsanitize=address /EHsc /Zi test.cpp`
24+
To fix it, have the compiler generate debug information by using a switch like [`/Zi`](../../build/reference/z7-zi-zi-debug-information-format.md#zi) or [`/Z7`](../../build/reference/z7-zi-zi-debug-information-format.md#z7), like this:
25+
26+
```cmd
27+
cl /fsanitize=address /EHsc /Zi test.cpp
28+
```
2529

2630
## See also
2731

0 commit comments

Comments
 (0)