Skip to content

Commit 2220aff

Browse files
authored
Merge pull request #5522 from Rageking8/structure-error-references-in-range-c2021-c2040
Structure error references in range [C2021, C2040]
2 parents d5b2034 + 129b6d7 commit 2220aff

19 files changed

+108
-71
lines changed

docs/error-messages/compiler-errors-1/compiler-error-c2021.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2021"
32
title: "Compiler Error C2021"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2021"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2021"]
66
helpviewer_keywords: ["C2021"]
7-
ms.assetid: 064f32e2-3794-48d5-9767-991003dcb36a
87
---
98
# Compiler Error C2021
109

11-
expected exponent value, not 'character'
10+
> expected exponent value, not 'character'
11+
12+
## Remarks
1213

1314
The character used as the exponent of a floating-point constant is not a valid number. Be sure to use an exponent that is in range.
1415

15-
## Examples
16+
## Example
1617

17-
The following sample generates C2021:
18+
The following example generates C2021:
1819

1920
```cpp
2021
// C2021.cpp
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2-
description: "Learn more about: Compiler Error C2022"
32
title: "Compiler Error C2022"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2022"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2022"]
66
helpviewer_keywords: ["C2022"]
7-
ms.assetid: 1f5c477a-d909-42d8-8588-811586e8ba1e
87
---
98
# Compiler Error C2022
109

11-
'number' : too big for character
10+
> 'number' : too big for character
11+
12+
## Remarks
1213

1314
The octal number following a backslash (\\) in a character or string constant is too big to represent a character.

docs/error-messages/compiler-errors-1/compiler-error-c2023.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Learn more about: Compiler Error C2023"
32
title: "Compiler Error C2023"
3+
description: "Learn more about: Compiler Error C2023"
44
ms.date: 08/18/2022
55
f1_keywords: ["C2023"]
66
helpviewer_keywords: ["C2023"]
@@ -9,11 +9,15 @@ helpviewer_keywords: ["C2023"]
99

1010
> '*identifier*': Alignment (*value-1*) different from prior declaration (*value-2*)
1111
12+
## Remarks
13+
1214
The compiler found an alignment specifier for a class type that's different from a previous declaration, or an **`enum`** alignment specifier that's different from the natural alignment of the base type.
1315

1416
To resolve this error, make sure all declarations and definitions of the type use the same alignment value.
1517

16-
The following sample generates C2023:
18+
## Example
19+
20+
The following example generates C2023:
1721

1822
```cpp
1923
// C2023.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2024.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Learn more about: Compiler Error C2024"
32
title: "Compiler Error C2024"
3+
description: "Learn more about: Compiler Error C2024"
44
ms.date: 08/18/2022
55
f1_keywords: ["C2024"]
66
helpviewer_keywords: ["C2024"]
@@ -9,11 +9,15 @@ helpviewer_keywords: ["C2024"]
99

1010
> 'alignas' attribute applies to variables, data members and tag types only
1111
12+
## Remarks
13+
1214
The compiler found an **`alignas`** specifier applied to a function or other type that can't be aligned.
1315

1416
To resolve this error, remove the **`alignas`** specifier.
1517

16-
The following sample generates C2024:
18+
## Example
19+
20+
The following example generates C2024:
1721

1822
```cpp
1923
// C2024.cpp
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Learn more about: Compiler Error C2025"
32
title: "Compiler Error C2025"
3+
description: "Learn more about: Compiler Error C2025"
44
ms.date: 08/18/2022
55
f1_keywords: ["C2025"]
66
helpviewer_keywords: ["C2025"]
@@ -9,6 +9,8 @@ helpviewer_keywords: ["C2025"]
99

1010
> invalid or corrupted binary module interface file: '*filename*'
1111
12+
## Remarks
13+
1214
The compiler could not read the specified IFC file.
1315

1416
To resolve this error, rebuild the module interface file.

docs/error-messages/compiler-errors-1/compiler-error-c2026.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ description: "Describes Microsoft C/C++ compiler error C2026, its causes and how
44
ms.date: 09/25/2020
55
f1_keywords: ["C2026"]
66
helpviewer_keywords: ["C2026"]
7-
ms.assetid: 8e64b6e1-b967-479b-be97-d12dc4a8e389
87
---
98
# Compiler Error C2026
109

1110
> string too big, trailing characters truncated
1211
13-
The string was longer than the limit of 16380 single-byte characters.
14-
1512
## Remarks
1613

14+
The string was longer than the limit of 16380 single-byte characters.
15+
1716
Before adjacent strings get concatenated, a string can't be longer than 16380 single-byte characters.
1817

1918
A Unicode string of about one half this length would also generate this error.

docs/error-messages/compiler-errors-1/compiler-error-c2027.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2027"
32
title: "Compiler Error C2027"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2027"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2027"]
66
helpviewer_keywords: ["C2027"]
7-
ms.assetid: a39150c0-ec04-45ec-934c-a838bfe76627
87
---
98
# Compiler Error C2027
109

11-
use of undefined type 'type'
10+
> use of undefined type 'type'
11+
12+
## Remarks
1213

1314
A type cannot be used until it is defined. To resolve the error, be sure the type is fully defined before referencing it.
1415

1516
## Examples
1617

17-
The following sample generates C2027.
18+
The following example generates C2027.
1819

1920
```cpp
2021
// C2027.cpp
@@ -36,7 +37,7 @@ int main() {
3637
3738
It is possible to declare a pointer to a declared but undefined type. But C++ does not allow a reference to an undefined type.
3839
39-
The following sample generates C2027.
40+
The following example generates C2027.
4041
4142
```cpp
4243
// C2027_b.cpp
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2-
description: "Learn more about: Compiler Error C2028"
32
title: "Compiler Error C2028"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2028"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2028"]
66
helpviewer_keywords: ["C2028"]
7-
ms.assetid: 4e92e944-8fce-4443-9baf-4411ad9bde70
87
---
98
# Compiler Error C2028
109

11-
struct/union member must be inside a struct/union
10+
> struct/union member must be inside a struct/union
11+
12+
## Remarks
1213

1314
Structure or union members must be declared within the structure or union.

docs/error-messages/compiler-errors-1/compiler-error-c2030.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Compiler Error C2030"
32
title: "Compiler Error C2030"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2030"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2030"]
66
helpviewer_keywords: ["C2030"]
7-
ms.assetid: 5806cead-64df-4eff-92de-52c9a3f5ee62
87
---
98
# Compiler Error C2030
109

11-
a destructor with 'protected private' accessibility cannot be a member of a class declared 'sealed'
10+
> a destructor with 'protected private' accessibility cannot be a member of a class declared 'sealed'
11+
12+
## Remarks
1213

1314
A Windows Runtime class declared as **`sealed`** cannot have a protected private destructor. Only public virtual and private non-virtual destructors are allowed on sealed types. For more information, see [Ref classes and structs](../../cppcx/ref-classes-and-structs-c-cx.md).
1415

docs/error-messages/compiler-errors-1/compiler-error-c2031.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Learn more about: Compiler Error C2031"
32
title: "Compiler Error C2031"
3+
description: "Learn more about: Compiler Error C2031"
44
ms.date: 08/18/2022
55
f1_keywords: ["C2031"]
66
helpviewer_keywords: ["C2031"]
@@ -10,6 +10,8 @@ helpviewer_keywords: ["C2031"]
1010
> a virtual destructor with '*accessibility*' accessibility is not allowed for this type\
1111
> a virtual destructor must have 'public' accessibility
1212
13+
## Remarks
14+
1315
A virtual Windows Runtime class has an access specifier or **`sealed`** specifier that's not allowed for a virtual destructor. For more information, see [Ref classes and structs](../../cppcx/ref-classes-and-structs-c-cx.md).
1416

1517
To fix this error, change the accessibility of the destructor.

0 commit comments

Comments
 (0)