Skip to content

Commit 12729a7

Browse files
Merge pull request #5617 from Rageking8/structure-error-references-in-range-c2651-c2670
Structure error references in range [C2651, C2670]
2 parents 9f12488 + a4847bc commit 12729a7

20 files changed

+133
-93
lines changed
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 C2651"
32
title: "Compiler Error C2651"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2651"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2651"]
66
helpviewer_keywords: ["C2651"]
7-
ms.assetid: c3524a89-47d1-43f6-9e20-2cda15f9ae8a
87
---
98
# Compiler Error C2651
109

11-
'data type' : left of 'operator' must be a class, struct or union
10+
> 'data type' : left of 'operator' must be a class, struct or union
11+
12+
## Remarks
1213

1314
To use a template parameter as if it is a class, specialize the class template with a class instead of an integral type.

docs/error-messages/compiler-errors-2/compiler-error-c2652.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 C2652"
32
title: "Compiler Error C2652"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2652"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2652"]
66
helpviewer_keywords: ["C2652"]
7-
ms.assetid: 6e3d1a90-a989-4088-8afd-dc82f6a2d66f
87
---
98
# Compiler Error C2652
109

11-
'identifier' : illegal copy constructor: first parameter must not be an 'identifier'
10+
> 'identifier' : illegal copy constructor: first parameter must not be an 'identifier'
11+
12+
## Remarks
1213

1314
The first parameter in the copy constructor has the same type as the class, structure, or union for which it is defined. The first parameter can be a reference to the type but not the type itself.
1415

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

1720
```cpp
1821
// C2652.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2653.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ helpviewer_keywords: ["C2653"]
99

1010
> '*identifier*' : is not a class or namespace name
1111
12+
## Remarks
13+
1214
The language syntax requires a class, structure, union, or namespace name here.
1315

1416
This error can occur when you use a name that has not been declared as a class, structure, union, or namespace in front of a scope operator. To fix this issue, declare the name or include the header that declares the name before it is used.
@@ -17,7 +19,7 @@ C2653 is also possible if you try to define a *compound namespace*, a namespace
1719

1820
## Examples
1921

20-
This sample generates C2653 because a scope name is used but not declared. The compiler expects a class, structure, union, or namespace name before a scope operator (::).
22+
This example generates C2653 because a scope name is used but not declared. The compiler expects a class, structure, union, or namespace name before a scope operator (::).
2123

2224
```cpp
2325
// C2653.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2654.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 C2654"
32
title: "Compiler Error C2654"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2654"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2654"]
66
helpviewer_keywords: ["C2654"]
7-
ms.assetid: ca7de1bd-576b-40bf-96fc-a91984827d20
87
---
98
# Compiler Error C2654
109

11-
'identifier' : attempt to access member outside a member function
10+
> 'identifier' : attempt to access member outside a member function
11+
12+
## Remarks
1213

1314
A member is accessed in a declaration. Member data can be accessed only in member functions.
1415

docs/error-messages/compiler-errors-2/compiler-error-c2655.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 C2655"
32
title: "Compiler Error C2655"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2655"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2655"]
66
helpviewer_keywords: ["C2655"]
7-
ms.assetid: beaefa6e-51b3-4df9-9150-960f3fbf40e0
87
---
98
# Compiler Error C2655
109

11-
'identifier' : definition or redeclaration illegal in current scope
10+
> 'identifier' : definition or redeclaration illegal in current scope
11+
12+
## Remarks
1213

1314
An identifier can be redeclared only at global scope.
1415

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

1720
```cpp
1821
// C2655.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2656.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 C2656"
32
title: "Compiler Error C2656"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2656"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2656"]
66
helpviewer_keywords: ["C2656"]
7-
ms.assetid: 1ec91186-0735-4904-859b-59da9af2d426
87
---
98
# Compiler Error C2656
109

11-
'function' : function not allowed as a bit field
10+
> 'function' : function not allowed as a bit field
11+
12+
## Remarks
1213

1314
A function is declared as a member of a bit field.
1415

docs/error-messages/compiler-errors-2/compiler-error-c2657.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Error C2657"
32
title: "Compiler Error C2657"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2657"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2657"]
66
helpviewer_keywords: ["C2657"]
7-
ms.assetid: f7cf29a9-684a-4605-9469-ecfee9ba4b03
87
---
98
# Compiler Error C2657
109

11-
'class::*' found at the start of a statement (did you forget to specify a type?)
10+
> 'class::*' found at the start of a statement (did you forget to specify a type?)
11+
12+
## Remarks
1213

1314
The line began with a pointer-to-member identifier.
1415

1516
This error can be caused by a missing type specifier in the declaration of a pointer to a member.
1617

17-
The following sample generates C2657:
18+
## Example
19+
20+
The following example generates C2657:
1821

1922
```cpp
2023
// C2657.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2658.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 C2658"
32
title: "Compiler Error C2658"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2658"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2658"]
66
helpviewer_keywords: ["C2658"]
7-
ms.assetid: 638368e8-7893-4a14-abec-13c768a9543a
87
---
98
# Compiler Error C2658
109

11-
'member': redefinition in anonymous struct/union
10+
> 'member': redefinition in anonymous struct/union
11+
12+
## Remarks
1213

1314
Two anonymous structures or unions contained member declarations with the same identifier but with different types. Under [/Za](../../build/reference/za-ze-disable-language-extensions.md), you will also get this error for members with the same identifier and type.
1415

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

1720
```cpp
1821
// C2658.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2659.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2659"
32
title: "Compiler Error C2659"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2659"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2659"]
66
helpviewer_keywords: ["C2659"]
7-
ms.assetid: b0883600-4d27-4ca7-a931-8ca6bd48654d
87
---
98
# Compiler Error C2659
109

11-
'operator' : function as left operand
10+
> 'operator' : function as left operand
11+
12+
## Remarks
13+
14+
A function was on the left side of the specified operator. The most common reason for this error is that the compiler has parsed the identifier on the left side of the operator as a function when the developer intended it to be a variable. For more information, see Wikipedia article [Most vexing parse](https://en.wikipedia.org/wiki/Most_vexing_parse).
15+
16+
## Examples
1217

13-
A function was on the left side of the specified operator. The most common reason for this error is that the compiler has parsed the identifier on the left side of the operator as a function when the developer intended it to be a variable. For more information, see Wikipedia article [Most vexing parse](https://en.wikipedia.org/wiki/Most_vexing_parse). This example shows a function declaration and a variable definition that are easily confused:
18+
This example shows a function declaration and a variable definition that are easily confused:
1419

1520
```cpp
1621
// C2659a.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2660.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Compiler Error C2660"
32
title: "Compiler Error C2660"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2660"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2660"]
66
helpviewer_keywords: ["C2660"]
7-
ms.assetid: 2e01a1db-4f00-4df6-a04d-cb6f70a6922b
87
---
98
# Compiler Error C2660
109

11-
'function' : function does not take number parameters
10+
> 'function' : function does not take number parameters
11+
12+
## Remarks
1213

1314
The function is called with an incorrect number of parameters.
1415

@@ -20,7 +21,7 @@ C2660 can occur if you accidentally call a Windows API function rather than an M
2021

2122
## Examples
2223

23-
The following sample generates C2660.
24+
The following example generates C2660.
2425

2526
```cpp
2627
// C2660.cpp
@@ -32,7 +33,7 @@ int main() {
3233
}
3334
```
3435
35-
C2660 can also occur if you attempt to directly call the Dispose method of a managed type. For more information, see [Destructors and finalizers](../../dotnet/how-to-define-and-consume-classes-and-structs-cpp-cli.md#BKMK_Destructors_and_finalizers). The following sample generates C2660.
36+
C2660 can also occur if you attempt to directly call the Dispose method of a managed type. For more information, see [Destructors and finalizers](../../dotnet/how-to-define-and-consume-classes-and-structs-cpp-cli.md#BKMK_Destructors_and_finalizers). The following example generates C2660.
3637
3738
```cpp
3839
// C2660_a.cpp

0 commit comments

Comments
 (0)