Skip to content

Commit e4a17e4

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2021, C2040]
1 parent dce2a9e commit e4a17e4

19 files changed

+51
-3
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ ms.assetid: 064f32e2-3794-48d5-9767-991003dcb36a
1010

1111
> expected exponent value, not 'character'
1212
13+
## Remarks
14+
1315
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.
1416

15-
## Examples
17+
## Example
1618

1719
The following sample generates C2021:
1820

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: 1f5c477a-d909-42d8-8588-811586e8ba1e
1010

1111
> 'number' : too big for character
1212
13+
## Remarks
14+
1315
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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ 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

18+
## Example
19+
1620
The following sample generates C2023:
1721

1822
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ 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

18+
## Example
19+
1620
The following sample generates C2024:
1721

1822
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ ms.assetid: 8e64b6e1-b967-479b-be97-d12dc4a8e389
1010

1111
> string too big, trailing characters truncated
1212
13-
The string was longer than the limit of 16380 single-byte characters.
14-
1513
## Remarks
1614

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

1919
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: a39150c0-ec04-45ec-934c-a838bfe76627
1010

1111
> use of undefined type 'type'
1212
13+
## Remarks
14+
1315
A type cannot be used until it is defined. To resolve the error, be sure the type is fully defined before referencing it.
1416

1517
## Examples

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: 4e92e944-8fce-4443-9baf-4411ad9bde70
1010

1111
> struct/union member must be inside a struct/union
1212
13+
## Remarks
14+
1315
Structure or union members must be declared within the structure or union.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 5806cead-64df-4eff-92de-52c9a3f5ee62
1010

1111
> a destructor with 'protected private' accessibility cannot be a member of a class declared 'sealed'
1212
13+
## Remarks
14+
1315
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).
1416

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

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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)