Skip to content

Commit 9d5826f

Browse files
authored
Merge pull request #5583 from Rageking8/structure-error-references-in-range-c2381-c2400
Structure error references in range [C2381, C2400]
2 parents f96a47e + ff361a7 commit 9d5826f

18 files changed

+121
-80
lines changed

docs/error-messages/compiler-errors-1/compiler-error-c2381.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 C2381"
32
title: "Compiler Error C2381"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2381"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2381"]
66
helpviewer_keywords: ["C2381"]
7-
ms.assetid: cc765f67-64ac-406f-93ef-ae7d548d58d7
87
---
98
# Compiler Error C2381
109

11-
'function' : redefinition; __declspec(noreturn) differs
10+
> 'function' : redefinition; __declspec(noreturn) differs
11+
12+
## Remarks
1213

1314
A function was declared and then defined but the definition used the [noreturn](../../cpp/noreturn.md) **`__declspec`** modifier. The use of `noreturn` constitutes a redefinition of the function; the declaration and definition need to agree on the use of `noreturn`.
1415

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

1720
```cpp
1821
// C2381.cpp

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
---
2-
description: "Learn more about: Compiler Error C2382"
32
title: "Compiler Error C2382"
3+
description: "Learn more about: Compiler Error C2382"
44
ms.date: 12/10/2021
55
f1_keywords: ["C2382"]
66
helpviewer_keywords: ["C2382"]
7-
ms.assetid: 4d4436f9-d0d6-4bd0-b8ec-767b89adfb2f
87
---
98
# Compiler Error C2382
109

1110
> '*function*' : redefinition; different exception specifications
1211
13-
This error indicates that a function overload was attempted only on the [exception specification](../../cpp/exception-specifications-throw-cpp.md).
14-
1512
## Remarks
1613

14+
This error indicates that a function overload was attempted only on the [exception specification](../../cpp/exception-specifications-throw-cpp.md).
15+
1716
By default, the compiler considers a `noexcept` specification to be equivalent to a `throw()` or `throw(some_type)` specification. Under [`/Za`](../../build/reference/za-ze-disable-language-extensions.md), this check is more strict.
1817

1918
To resolve this issue, change all declarations and definitions of the function (or the specific function overload) to use the same exception specification.
2019

2120
## Example
2221

23-
The following sample generates C2382:
22+
The following example generates C2382:
2423

2524
```cpp
2625
// C2382.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2383.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 C2383"
32
title: "Compiler Error C2383"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2383"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2383"]
66
helpviewer_keywords: ["C2383"]
7-
ms.assetid: 6696221d-879c-477a-a0f3-a6edc15fd3d7
87
---
98
# Compiler Error C2383
109

11-
'*symbol*' : default-arguments are not allowed on this symbol
10+
> '*symbol*' : default-arguments are not allowed on this symbol
11+
12+
## Remarks
1213

1314
The C++ compiler does not allow default arguments on pointers to functions.
1415

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
---
2-
description: "Learn more about: Compiler Error C2384"
32
title: "Compiler Error C2384"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2384"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2384"]
66
helpviewer_keywords: ["C2384"]
7-
ms.assetid: 8145f7ad-31b1-406d-ac43-0d557feab635
87
---
98
# Compiler Error C2384
109

11-
'member' : cannot apply __declspec(thread) to a member of a managed or WinRT class
10+
> 'member' : cannot apply __declspec(thread) to a member of a managed or WinRT class
11+
12+
## Remarks
1213

1314
The [thread](../../cpp/thread.md) **`__declspec`** modifier cannot be used on a member of a managed or Windows Runtime class.
1415

1516
Static thread local storage in managed code can only be used for statically loaded DLLs—the DLL must be statically loaded when the process starts. Windows Runtime does not support thread local storage.
1617

18+
## Example
19+
1720
The following line generates C2384 and shows how to fix it in C++/CLI code:
1821

1922
```cpp

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
---
2-
description: "Learn more about: Compiler Error C2385"
32
title: "Compiler Error C2385"
4-
ms.date: "1/19/2024"
3+
description: "Learn more about: Compiler Error C2385"
4+
ms.date: 1/19/2024
55
f1_keywords: ["C2385"]
66
helpviewer_keywords: ["C2385"]
77
---
88
# Compiler Error C2385
99

1010
> ambiguous access of 'member'
1111
12+
## Remarks
13+
1214
A member is inherited from more than one base type, making unqualified access to that member ambiguous. To resolve this error:
1315

1416
- Explicitly qualify access to the member.
@@ -18,7 +20,7 @@ A member is inherited from more than one base type, making unqualified access to
1820

1921
## Example
2022

21-
The following sample generates C2385:
23+
The following example generates C2385:
2224

2325
```cpp
2426
// C2385.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2386.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 C2386"
32
title: "Compiler Error C2386"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2386"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2386"]
66
helpviewer_keywords: ["C2386"]
7-
ms.assetid: aaaa1284-34a0-4da2-8547-9fcbb559dae0
87
---
98
# Compiler Error C2386
109

11-
'symbol' : a symbol with this name already exists in the current scope
10+
> 'symbol' : a symbol with this name already exists in the current scope
11+
12+
## Remarks
1213

1314
You tried to create a namespace alias, but the name you chose already exists.
1415

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

1720
```cpp
1821
// C2386.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2387.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 C2387"
32
title: "Compiler Error C2387"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2387"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2387"]
66
helpviewer_keywords: ["C2387"]
7-
ms.assetid: 6847b8e1-ffac-458d-ab88-0c92f72f2527
87
---
98
# Compiler Error C2387
109

11-
'type' : ambiguous base class
10+
> 'type' : ambiguous base class
11+
12+
## Remarks
1213

1314
The compiler could not unambiguously resolve a function call because the function exists in more than one base class.
1415

1516
To resolve this error, either remove one of the base classes from the inheritance, or explicitly qualify the function call.
1617

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

1922
```cpp
2023
// C2387.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2388.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 C2388"
32
title: "Compiler Error C2388"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2388"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2388"]
66
helpviewer_keywords: ["C2388"]
7-
ms.assetid: 764ad2d7-cb04-425f-ba30-70989488c4a4
87
---
98
# Compiler Error C2388
109

11-
'symbol' : a symbol cannot be declared with both __declspec(appdomain) and \__declspec(process)
10+
> 'symbol' : a symbol cannot be declared with both __declspec(appdomain) and \__declspec(process)
11+
12+
## Remarks
1213

1314
The `appdomain` and `process` **`__declspec`** modifiers cannot be used on the same symbol. The storage for a variable exists per process or per application domain.
1415

1516
For more information, see [appdomain](../../cpp/appdomain.md) and [process](../../cpp/process.md).
1617

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

1922
```cpp
2023
// C2388.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2389.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 C2389"
32
title: "Compiler Error C2389"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2389"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2389"]
66
helpviewer_keywords: ["C2389"]
7-
ms.assetid: 6122dc81-4ee3-49a5-a67d-d867808c9bac
87
---
98
# Compiler Error C2389
109

11-
'operator' : illegal operand 'nullptr'
10+
> 'operator' : illegal operand 'nullptr'
11+
12+
## Remarks
1213

1314
**`nullptr`** cannot be an operand.
1415

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

1720
```cpp
1821
// C2389.cpp

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Compiler Error C2390"
32
title: "Compiler Error C2390"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2390"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2390"]
66
helpviewer_keywords: ["C2390"]
7-
ms.assetid: 06b749ee-d072-4db1-b229-715f2c0728b5
87
---
98
# Compiler Error C2390
109

11-
'identifier' : incorrect storage class 'specifier'
10+
> 'identifier' : incorrect storage class 'specifier'
11+
12+
## Remarks
1213

1314
The storage class is not valid for the global-scope identifier. The default storage class is used in place of the invalid class.
1415

@@ -22,7 +23,7 @@ Possible resolutions:
2223

2324
## Example
2425

25-
- The following sample generates C2390:
26+
The following example generates C2390:
2627

2728
```cpp
2829
// C2390.cpp

0 commit comments

Comments
 (0)