Skip to content

Commit c785b6e

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2461, C2490]
1 parent 0ae844d commit c785b6e

20 files changed

+64
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: e64ba651-f441-4fdb-b5cb-4209bbbe4db4
1010

1111
> '*class*' : constructor syntax missing formal parameters
1212
13+
## Remarks
14+
1315
The constructor for the class does not specify any formal parameters. The declaration of a constructor must specify a formal parameter list. The list can be empty.
1416

1517
To fix this issue, add a pair of parentheses after the declaration of *class*::**class*.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ helpviewer_keywords: ["C2462"]
99

1010
> 'identifier' : cannot define a type in a 'new-expression'
1111
12+
## Remarks
13+
1214
You cannot define a type in the operand field of the **`new`** operator. Put the type definition in a separate statement.
1315

16+
## Example
17+
1418
The following sample generates C2462:
1519

1620
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: ace953d6-b414-49ee-bfef-90578a8da00c
1010

1111
> 'identifier' : cannot use 'new' to allocate a reference
1212
13+
## Remarks
14+
1315
A reference identifier was allocated with the **`new`** operator. References are not memory objects, so **`new`** cannot return a pointer to them. Use the standard variable declaration syntax to declare a reference.
1416

17+
## Example
18+
1519
The following sample generates C2464:
1620

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: 65ba2a9f-d95e-4af3-b60b-1ac59a1e307c
1010

1111
> cannot define an anonymous type inside parentheses
1212
13+
## Remarks
14+
1315
An anonymous structure, union, or enumerated type is defined inside a parenthetical expression. This is invalid in C++ because the definition is meaningless in function scope.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ helpviewer_keywords: ["C2466"]
99

1010
> cannot allocate an array of constant size 0
1111
12+
## Remarks
13+
1214
An array is allocated or declared with size zero. The constant expression for the array size must be an integer greater than zero. An array declaration with a zero subscript is legal only for a class, structure, or union member and only with Microsoft extensions ([/Ze](../../build/reference/za-ze-disable-language-extensions.md)).
1315

16+
## Example
17+
1418
The following sample generates C2466:
1519

1620
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: f9ead270-5d0b-41cc-bdcd-586a647c67a7
1010

1111
> illegal declaration of anonymous 'user-defined-type'
1212
13+
## Remarks
14+
1315
A nested user-defined type was declared. This is an error when compiling C source code with the ANSI compatibility option ([/Za](../../build/reference/za-ze-disable-language-extensions.md)) enabled.
1416

17+
## Example
18+
1519
The following sample generates C2467:
1620

1721
```c

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ helpviewer_keywords: ["C2470"]
99

1010
> '*function*': looks like a function definition, but there is no parameter list; skipping apparent body
1111
12+
## Remarks
13+
1214
A function definition is missing its argument list.
1315

1416
## Example

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: a8928b44-20f6-4cbc-9aa5-7e86052a9c6b
1010

1111
> cannot update program database 'file'
1212
13+
## Remarks
14+
1315
The compiler cannot write to the database file.
1416

1517
### To fix the problem

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 6bb7dbf5-b198-490f-860e-fd64d0c2a284
1010

1111
> 'identifier' : looks like a function definition, but there is no parameter list.
1212
13+
## Remarks
14+
1315
The compiler detected what looked like a function, without the parameter list.
1416

1517
## Example

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 64e6c61e-6e77-480e-bcf0-b30a2fc482ac
1010

1111
> 'keyword' : missing an adjacent semicolon, could be either keyword or identifier.
1212
13+
## Remarks
14+
1315
The compiler expected to find a semicolon, and was unable to determine your intent. Add the semicolon to resolve this error.
1416

1517
## Example

0 commit comments

Comments
 (0)