Skip to content

Commit 270ac17

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2651, C2670]
1 parent 3a3da87 commit 270ac17

20 files changed

+59
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: c3524a89-47d1-43f6-9e20-2cda15f9ae8a
1010

1111
> 'data type' : left of 'operator' must be a class, struct or union
1212
13+
## Remarks
14+
1315
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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 6e3d1a90-a989-4088-8afd-dc82f6a2d66f
1010

1111
> 'identifier' : illegal copy constructor: first parameter must not be an 'identifier'
1212
13+
## Remarks
14+
1315
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.
1416

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

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
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.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: ca7de1bd-576b-40bf-96fc-a91984827d20
1010

1111
> 'identifier' : attempt to access member outside a member function
1212
13+
## Remarks
14+
1315
A member is accessed in a declaration. Member data can be accessed only in member functions.
1416

1517
This error can be caused when trying to initialize variables in a declaration. Use a constructor for this purpose.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: beaefa6e-51b3-4df9-9150-960f3fbf40e0
1010

1111
> 'identifier' : definition or redeclaration illegal in current scope
1212
13+
## Remarks
14+
1315
An identifier can be redeclared only at global scope.
1416

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

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 1ec91186-0735-4904-859b-59da9af2d426
1010

1111
> 'function' : function not allowed as a bit field
1212
13+
## Remarks
14+
1315
A function is declared as a member of a bit field.
1416

1517
This error can be caused by a syntax error in a constructor initializer list.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: f7cf29a9-684a-4605-9469-ecfee9ba4b03
1010

1111
> 'class::*' found at the start of a statement (did you forget to specify a type?)
1212
13+
## Remarks
14+
1315
The line began with a pointer-to-member identifier.
1416

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

19+
## Example
20+
1721
The following sample generates C2657:
1822

1923
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 638368e8-7893-4a14-abec-13c768a9543a
1010

1111
> 'member': redefinition in anonymous struct/union
1212
13+
## Remarks
14+
1315
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.
1416

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

1721
```cpp

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ ms.assetid: b0883600-4d27-4ca7-a931-8ca6bd48654d
1010

1111
> 'operator' : function as left operand
1212
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:
13+
## Remarks
14+
15+
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).
16+
17+
## Examples
18+
19+
This example shows a function declaration and a variable definition that are easily confused:
1420

1521
```cpp
1622
// C2659a.cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 2e01a1db-4f00-4df6-a04d-cb6f70a6922b
1010

1111
> 'function' : function does not take number parameters
1212
13+
## Remarks
14+
1315
The function is called with an incorrect number of parameters.
1416

1517
C2660 can occur if you accidentally call a Windows API function rather than an MFC member function of the same name. To solve this problem:

0 commit comments

Comments
 (0)