Skip to content

Commit fa87cf7

Browse files
authored
Merge pull request #5531 from Rageking8/structure-error-references-in-range-c2061-c2080
Structure error references in range [C2061, C2080]
2 parents 9bf691d + 53915d5 commit fa87cf7

20 files changed

+118
-81
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
---
2-
description: "Learn more about: Compiler Error C2061"
32
title: "Compiler Error C2061"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2061"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2061"]
66
helpviewer_keywords: ["C2061"]
7-
ms.assetid: b0e61c0c-a205-4820-b9aa-301d6c6fe6eb
87
---
98
# Compiler Error C2061
109

11-
syntax error : identifier 'identifier'
10+
> syntax error : identifier 'identifier'
11+
12+
## Remarks
1213

1314
The compiler found an identifier where it wasn't expected. Make sure that `identifier` is declared before you use it.
1415

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

1718
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:
1819

19-
The following sample generates C2061:
20+
## Examples
21+
22+
The following example generates C2061:
2023

2124
```cpp
2225
// C2061.cpp

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2062"
32
title: "Compiler Error C2062"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2062"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2062"]
66
helpviewer_keywords: ["C2062"]
7-
ms.assetid: 6cc98353-2ddf-43ab-88a2-9cc91cdd6033
87
---
98
# Compiler Error C2062
109

11-
type 'type' unexpected
10+
> type 'type' unexpected
11+
12+
## Remarks
1213

1314
The compiler did not expect a type name.
1415

15-
The following sample generates C2062:
16+
## Example
17+
18+
The following example generates C2062:
1619

1720
```cpp
1821
// C2062.cpp

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2063"
32
title: "Compiler Error C2063"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2063"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2063"]
66
helpviewer_keywords: ["C2063"]
7-
ms.assetid: 0a90c18f-4029-416a-9128-e8713b53e6f1
87
---
98
# Compiler Error C2063
109

11-
'identifier' : not a function
10+
> 'identifier' : not a function
11+
12+
## Remarks
1213

1314
The identifier is used as a function but not declared as a function.
1415

15-
The following sample generates C2063:
16+
## Example
17+
18+
The following example generates C2063:
1619

1720
```c
1821
// C2063.c

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2064"
32
title: "Compiler Error C2064"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2064"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2064"]
66
helpviewer_keywords: ["C2064"]
7-
ms.assetid: 6cda05da-f437-4f50-9813-ae69538713a3
87
---
98
# Compiler Error C2064
109

11-
term does not evaluate to a function taking N arguments
10+
> term does not evaluate to a function taking N arguments
11+
12+
## Remarks
1213

1314
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.
1415

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

1720
```cpp
1821
// C2064.cpp
@@ -24,7 +27,7 @@ void func() {
2427
}
2528
```
2629

27-
You must call pointers to non-static member functions from the context of an object instance. The following sample generates C2064, and shows how to fix it:
30+
You must call pointers to non-static member functions from the context of an object instance. The following example generates C2064, and shows how to fix it:
2831

2932
```cpp
3033
// C2064b.cpp
@@ -43,7 +46,7 @@ int main() {
4346
}
4447
```
4548
46-
Within a class, member function pointers must also indicate the calling object context. The following sample generates C2064 and shows how to fix it:
49+
Within a class, member function pointers must also indicate the calling object context. The following example generates C2064 and shows how to fix it:
4750
4851
```cpp
4952
// C2064d.cpp

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2-
description: "Learn more about: Compiler Error C2065"
32
title: "Compiler Error C2065"
3+
description: "Learn more about: Compiler Error C2065"
44
ms.date: 06/29/2022
55
f1_keywords: ["C2065"]
66
helpviewer_keywords: ["C2065"]
7-
ms.assetid: 78093376-acb7-45f5-9323-5ed7e0aab1dc
87
---
98
# Compiler Error C2065
109

1110
> '*identifier*' : undeclared identifier
1211
12+
## Remarks
13+
1314
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).
1415

1516
Here are some common issues and solutions in greater detail.
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 C2066"
32
title: "Compiler Error C2066"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2066"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2066"]
66
helpviewer_keywords: ["C2066"]
7-
ms.assetid: f1efc63f-948a-410b-bf6e-ba250d52cd38
87
---
98
# Compiler Error C2066
109

11-
cast to function type is illegal
10+
> cast to function type is illegal
11+
12+
## Remarks
1213

1314
In ANSI C, it is not legal to cast between a function pointer and a data pointer.
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 C2067"
32
title: "Compiler Error C2067"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2067"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2067"]
66
helpviewer_keywords: ["C2067"]
7-
ms.assetid: 97cab473-a713-489f-8536-ca2cc5792b8c
87
---
98
# Compiler Error C2067
109

11-
cast to array type is illegal
10+
> cast to array type is illegal
11+
12+
## Remarks
1213

1314
An object was cast to an array type.

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Learn more about: Compiler Error C2068"
32
title: "Compiler Error C2068"
3+
description: "Learn more about: Compiler Error C2068"
44
ms.date: 08/18/2022
55
f1_keywords: ["C2068"]
66
helpviewer_keywords: ["C2068"]
@@ -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
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 C2069"
32
title: "Compiler Error C2069"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2069"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2069"]
66
helpviewer_keywords: ["C2069"]
7-
ms.assetid: 0c87445a-9eed-4917-a733-f08217f2d64d
87
---
98
# Compiler Error C2069
109

11-
cast of 'void' term to non-'void'
10+
> cast of 'void' term to non-'void'
11+
12+
## Remarks
1213

1314
Type **`void`** cannot be cast to any other type.

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2070"
32
title: "Compiler Error C2070"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2070"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2070"]
66
helpviewer_keywords: ["C2070"]
7-
ms.assetid: 4c8dea63-1227-4aba-be26-2462537f86fb
87
---
98
# Compiler Error C2070
109

11-
'type': illegal sizeof operand
10+
> 'type': illegal sizeof operand
11+
12+
## Remarks
1213

1314
The [sizeof](../../cpp/sizeof-operator.md) operator requires an expression or type name.
1415

15-
The following sample generates C2070:
16+
## Example
17+
18+
The following example generates C2070:
1619

1720
```cpp
1821
// C2070.cpp

0 commit comments

Comments
 (0)