Skip to content

Commit 4a98957

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2491, C2520]
1 parent 5d6ebc7 commit 4a98957

24 files changed

+86
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: 4e5a8f81-124e-402c-a5ec-d35a89b5469e
1010

1111
> 'identifier' : definition of dllimport function not allowed
1212
13+
## Remarks
14+
1315
Data, static data members, and functions can be declared as `dllimport`s but not defined as `dllimport`s.
1416

1517
To fix this issue, remove the `__declspec(dllimport)` specifier from the definition of the function.
1618

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

1923
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 8c44c9bb-c366-4fe5-a0ab-882e38608aaa
1010

1111
> '*variable*': data with thread storage duration may not have dll interface
1212
13+
## Remarks
14+
1315
The variable is declared with the [thread](../../cpp/thread.md) attribute and with the DLL interface. The address of the `thread` variable is not known until run time, so it cannot be linked to a DLL import or export.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 68316cd5-682b-49c3-b6ea-23c4e5d296cf
1010

1111
> illegal form of __based
1212
13+
## Remarks
14+
1315
A **`__based`** expression must be based on a pointer.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 5dfd07ab-351d-49c9-b54e-f0a104776ab8
1010

1111
> '*keyword*' cannot be called from within a filter expression or __finally/finally block
1212
13+
## Remarks
14+
1315
You cannot use *keyword* in a **`__finally`** or **`finally`** block.
1416

17+
## Examples
18+
1519
The following sample generates C2494:
1620

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: bb7066fe-3549-4901-97e4-157f3c04dd57
1010

1111
> 'identifier' : 'nothrow' can only be applied to function declarations or definitions
1212
13+
## Remarks
14+
1315
The [nothrow](../../cpp/nothrow-cpp.md) extended attribute can be applied to function declarations or definitions only.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 9a25237d-5bbb-4112-98f3-29cd99d3f89f
1010

1111
> 'identifier' : 'selectany' can only be applied to data items with external linkage
1212
13+
## Remarks
14+
1315
The [selectany](../../cpp/selectany.md) attribute can be applied only to externally visible and global data items.
1416

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

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 0839f12c-aaa4-4a02-bb33-7f072715dd14
1010

1111
> 'function' : 'novtable' can only be applied to class declarations or definitions
1212
13+
## Remarks
14+
1315
This error can be caused by using `__declspec(novtable)` with a function.
1416

1517
## Example

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: b323ff4d-b3c1-4bfd-b052-ae7292d53222
1010

1111
> 'class' : a class cannot be its own base class
1212
13+
## Remarks
14+
1315
You attempted to specify the class that you are defining as a base class.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@ ms.assetid: 6bff8161-dc9a-48ca-91f1-fd2eefdbbc93
1010

1111
> 'identifier1' : 'identifier2' is already a direct base class
1212
13+
## Remarks
14+
1315
A class or structure appears more than once in a list of base classes.
1416

1517
A direct base is one mentioned in the base list. An indirect base is a base class of one of the classes in the base list.
1618

1719
A class cannot be specified as a direct base class more than once. A class can be used as an indirect base class more than once.
1820

21+
## Example
22+
1923
The following sample generates C2500:
2024

2125
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: affa0b86-15fc-4e17-b7f2-6aad4a3771c4
1010

1111
> 'identifier' : too many access modifiers on the base class
1212
13+
## Remarks
14+
1315
The base class has more than one access modifier. Only one access modifier (**`public`**, **`private`**, or **`protected`**) is allowed.
1416

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

1721
```cpp

0 commit comments

Comments
 (0)