Skip to content

Commit 3054fcc

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2731, C2760]
1 parent 9f8372c commit 3054fcc

22 files changed

+75
-1
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 9b563999-febd-4582-9147-f355083c091e
1010

1111
> 'identifier' : function cannot be overloaded
1212
13+
## Remarks
14+
1315
The functions `main`, `WinMain`, `DllMain`, and `LibMain` cannot be overloaded.
1416

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

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 01b7ad2c-93cf-456f-a4c0-c5f2fdc7c07c
1010

1111
> linkage specification contradicts earlier specification for 'function'
1212
13+
## Remarks
14+
1315
The function is already declared with a different linkage specifier.
1416

1517
This error can be caused by include files with different linkage specifiers.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 67f83561-c633-407c-a2ee-f9fd16e165bf
1010

1111
> you cannot overload a function with 'C' linkage
1212
13+
## Remarks
14+
1315
More than one overloaded function is declared with `extern "C"` linkage. When using `"C"` linkage, only one form of a specified function can be external. Since overloaded functions have the same undecorated name, they can't be used with C programs.
1416

1517
This error may occur after an upgrade because of conformance changes in Visual Studio 2019. Starting in Visual Studio 2019 version 16.3, the [`/Zc:externC-`](../../build/reference/zc-externc.md) compiler option relaxes this check. The option must come after any [`/permissive-`](../../build/reference/permissive-standards-conformance.md) option on the command line.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: e53a77b7-825c-42d1-a655-90e1c93b833e
1010

1111
> 'identifier' : const object must be initialized if not extern
1212
13+
## Remarks
14+
1315
The identifier is declared **`const`** but not initialized or **`extern`**.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 6ce45600-7148-4bc0-8699-af0ef137571e
1010

1111
> 'keyword' keyword is not permitted in formal parameter type specifier
1212
13+
## Remarks
14+
1315
The keyword is invalid in this context.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 95a6bc28-c0cb-49dc-87e6-e993dbbba881
1010

1111
> 'keyword' keyword is not permitted in cast
1212
13+
## Remarks
14+
1315
The keyword is invalid in a cast.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 896b4640-1ee0-4cd8-9910-de3efa30006a
1010

1111
> 'declaration' : is ambiguous or is not a member of 'type'
1212
13+
## Remarks
14+
1315
A function was declared incorrectly.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 5b63e435-7631-43d7-805e-f2adefb7e517
1010

1111
> 'number' : explicit managed or WinRT array dimensions must be between 1 and 32
1212
13+
## Remarks
14+
1315
An array dimension was not between 1 and 32.
1416

17+
## Example
18+
1519
The following sample generates C2739 and shows how to fix it:
1620

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 644cd444-21d2-471d-a176-f5f52c5a0b73
1010

1111
> 'type' : cannot catch a native type with __clrcall destructor or copy constructor
1212
13+
## Remarks
14+
1315
A module compiled with **/clr** attempted to catch an exception of native type and where the type's destructor or copy constructor uses `__clrcall` calling convention.
1416

1517
When compiled with **/clr**, exception handling expects the member functions in a native type to be [__cdecl](../../cpp/cdecl.md) and not [__clrcall](../../cpp/clrcall.md). Native types with member functions using `__clrcall` calling convention cannot be caught in a module compiled with **/clr**.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: a1c45f13-7667-4678-aa16-265304a449a1
1010

1111
> 'token' : this token cannot be converted to an identifier
1212
13+
## Remarks
14+
1315
Identifiers must be comprised of legal characters.
1416

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

1721
```cpp

0 commit comments

Comments
 (0)