Skip to content

Commit 39a9f23

Browse files
Merge pull request #5596 from Rageking8/structure-error-references-in-range-c2491-c2520
Structure error references in range [C2491, C2520]
2 parents 74c3c50 + bf37f2c commit 39a9f23

24 files changed

+178
-116
lines changed

docs/error-messages/compiler-errors-1/compiler-error-c2491.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 C2491"
32
title: "Compiler Error C2491"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2491"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2491"]
66
helpviewer_keywords: ["C2491"]
7-
ms.assetid: 4e5a8f81-124e-402c-a5ec-d35a89b5469e
87
---
98
# Compiler Error C2491
109

11-
'identifier' : definition of dllimport function not allowed
10+
> 'identifier' : definition of dllimport function not allowed
11+
12+
## Remarks
1213

1314
Data, static data members, and functions can be declared as `dllimport`s but not defined as `dllimport`s.
1415

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

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

1922
```cpp
2023
// C2491.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2492.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 C2492"
32
title: "Compiler Error C2492"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2492"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2492"]
66
helpviewer_keywords: ["C2492"]
7-
ms.assetid: 8c44c9bb-c366-4fe5-a0ab-882e38608aaa
87
---
98
# Compiler Error C2492
109

11-
'*variable*': data with thread storage duration may not have dll interface
10+
> '*variable*': data with thread storage duration may not have dll interface
11+
12+
## Remarks
1213

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

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

1720
```cpp
1821
// C2492.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2493.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 C2493"
32
title: "Compiler Error C2493"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2493"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2493"]
66
helpviewer_keywords: ["C2493"]
7-
ms.assetid: 68316cd5-682b-49c3-b6ea-23c4e5d296cf
87
---
98
# Compiler Error C2493
109

11-
illegal form of __based
10+
> illegal form of __based
11+
12+
## Remarks
1213

1314
A **`__based`** expression must be based on a pointer.
1415

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

1720
```cpp
1821
// C2493.cpp

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2494"
32
title: "Compiler Error C2494"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2494"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2494"]
66
helpviewer_keywords: ["C2494"]
7-
ms.assetid: 5dfd07ab-351d-49c9-b54e-f0a104776ab8
87
---
98
# Compiler Error C2494
109

1110
> '*keyword*' cannot be called from within a filter expression or __finally/finally block
1211
12+
## Remarks
13+
1314
You cannot use *keyword* in a **`__finally`** or **`finally`** block.
1415

15-
The following sample generates C2494:
16+
## Examples
17+
18+
The following example generates C2494:
1619

1720
```cpp
1821
// C2494.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2495.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 C2495"
32
title: "Compiler Error C2495"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2495"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2495"]
66
helpviewer_keywords: ["C2495"]
7-
ms.assetid: bb7066fe-3549-4901-97e4-157f3c04dd57
87
---
98
# Compiler Error C2495
109

11-
'identifier' : 'nothrow' can only be applied to function declarations or definitions
10+
> 'identifier' : 'nothrow' can only be applied to function declarations or definitions
11+
12+
## Remarks
1213

1314
The [nothrow](../../cpp/nothrow-cpp.md) extended attribute can be applied to function declarations or definitions only.
1415

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

1720
```cpp
1821
// C2495.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2496.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 C2496"
32
title: "Compiler Error C2496"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2496"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2496"]
66
helpviewer_keywords: ["C2496"]
7-
ms.assetid: 9a25237d-5bbb-4112-98f3-29cd99d3f89f
87
---
98
# Compiler Error C2496
109

11-
'identifier' : 'selectany' can only be applied to data items with external linkage
10+
> 'identifier' : 'selectany' can only be applied to data items with external linkage
11+
12+
## Remarks
1213

1314
The [selectany](../../cpp/selectany.md) attribute can be applied only to externally visible and global data items.
1415

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

1720
```cpp
1821
// C2496.cpp

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2498"
32
title: "Compiler Error C2498"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2498"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2498"]
66
helpviewer_keywords: ["C2498"]
7-
ms.assetid: 0839f12c-aaa4-4a02-bb33-7f072715dd14
87
---
98
# Compiler Error C2498
109

11-
'function' : 'novtable' can only be applied to class declarations or definitions
10+
> 'function' : 'novtable' can only be applied to class declarations or definitions
11+
12+
## Remarks
1213

1314
This error can be caused by using `__declspec(novtable)` with a function.
1415

1516
## Example
1617

17-
The following sample generates C2498:
18+
The following example generates C2498:
1819

1920
```cpp
2021
// C2498.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2499.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 C2499"
32
title: "Compiler Error C2499"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2499"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2499"]
66
helpviewer_keywords: ["C2499"]
7-
ms.assetid: b323ff4d-b3c1-4bfd-b052-ae7292d53222
87
---
98
# Compiler Error C2499
109

11-
'class' : a class cannot be its own base class
10+
> 'class' : a class cannot be its own base class
11+
12+
## Remarks
1213

1314
You attempted to specify the class that you are defining as a base class.
1415

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

1720
```cpp
1821
// C2499.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2500.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 C2500"
32
title: "Compiler Error C2500"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2500"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2500"]
66
helpviewer_keywords: ["C2500"]
7-
ms.assetid: 6bff8161-dc9a-48ca-91f1-fd2eefdbbc93
87
---
98
# Compiler Error C2500
109

11-
'identifier1' : 'identifier2' is already a direct base class
10+
> 'identifier1' : 'identifier2' is already a direct base class
11+
12+
## Remarks
1213

1314
A class or structure appears more than once in a list of base classes.
1415

1516
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.
1617

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

19-
The following sample generates C2500:
20+
## Example
21+
22+
The following example generates C2500:
2023

2124
```cpp
2225
// C2500.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2502.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 C2502"
32
title: "Compiler Error C2502"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2502"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2502"]
66
helpviewer_keywords: ["C2502"]
7-
ms.assetid: affa0b86-15fc-4e17-b7f2-6aad4a3771c4
87
---
98
# Compiler Error C2502
109

11-
'identifier' : too many access modifiers on the base class
10+
> 'identifier' : too many access modifiers on the base class
11+
12+
## Remarks
1213

1314
The base class has more than one access modifier. Only one access modifier (**`public`**, **`private`**, or **`protected`**) is allowed.
1415

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

1720
```cpp
1821
// C2502.cpp

0 commit comments

Comments
 (0)