Skip to content

Commit 4db7a0b

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2061, C2080]
1 parent e6f7b5c commit 4db7a0b

18 files changed

+54
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@ ms.assetid: b0e61c0c-a205-4820-b9aa-301d6c6fe6eb
1010

1111
> syntax error : identifier 'identifier'
1212
13+
## Remarks
14+
1315
The compiler found an identifier where it wasn't expected. Make sure that `identifier` is declared before you use it.
1416

1517
An initializer may be enclosed by parentheses. To avoid this problem, enclose the declarator in parentheses or make it a **`typedef`**.
1618

1719
This error could also be caused when the compiler detects an expression as a class template argument; use [typename](../../cpp/typename.md) to tell the compiler it is a type, as shown in the following example:
1820

21+
## Examples
22+
1923
The following sample generates C2061:
2024

2125
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 6cc98353-2ddf-43ab-88a2-9cc91cdd6033
1010

1111
> type 'type' unexpected
1212
13+
## Remarks
14+
1315
The compiler did not expect a type name.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 0a90c18f-4029-416a-9128-e8713b53e6f1
1010

1111
> 'identifier' : not a function
1212
13+
## Remarks
14+
1315
The identifier is used as a function but not declared as a function.
1416

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

1721
```c

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 6cda05da-f437-4f50-9813-ae69538713a3
1010

1111
> term does not evaluate to a function taking N arguments
1212
13+
## Remarks
14+
1315
A call is made to a function through an expression. The expression does not evaluate to a pointer to a function that takes the specified number of arguments.
1416

17+
## Examples
18+
1519
In this example, the code attempts to call non-functions as functions. The following sample generates C2064:
1620

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 78093376-acb7-45f5-9323-5ed7e0aab1dc
1010

1111
> '*identifier*' : undeclared identifier
1212
13+
## Remarks
14+
1315
The compiler can't find the declaration for an identifier. There are many possible causes for this error. The most common causes of C2065 are that the identifier hasn't been declared, the identifier is misspelled, the header where the identifier is declared isn't included in the file, or the identifier is missing a scope qualifier, for example, `cout` instead of `std::cout`. For more information on declarations in C++, see [Declarations and Definitions (C++)](../../cpp/declarations-and-definitions-cpp.md).
1416

1517
Here are some common issues and solutions in greater detail.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: f1efc63f-948a-410b-bf6e-ba250d52cd38
1010

1111
> cast to function type is illegal
1212
13+
## Remarks
14+
1315
In ANSI C, it is not legal to cast between a function pointer and a data pointer.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: 97cab473-a713-489f-8536-ca2cc5792b8c
1010

1111
> cast to array type is illegal
1212
13+
## Remarks
14+
1315
An object was cast to an array type.

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

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

1010
> illegal use of overloaded function. Missing argument list?
1111
12+
## Remarks
13+
1214
The compiler detected the invalid use of an overloaded function with no arguments.
1315

16+
## Example
17+
1418
For example:
1519

1620
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: 0c87445a-9eed-4917-a733-f08217f2d64d
1010

1111
> cast of 'void' term to non-'void'
1212
13+
## Remarks
14+
1315
Type **`void`** cannot be cast to any other type.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 4c8dea63-1227-4aba-be26-2462537f86fb
1010

1111
> 'type': illegal sizeof operand
1212
13+
## Remarks
14+
1315
The [sizeof](../../cpp/sizeof-operator.md) operator requires an expression or type name.
1416

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

1721
```cpp

0 commit comments

Comments
 (0)