Skip to content

Commit 46a375b

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2381, C2400]
1 parent 8370a68 commit 46a375b

17 files changed

+58
-2
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: cc765f67-64ac-406f-93ef-ae7d548d58d7
1010

1111
> 'function' : redefinition; __declspec(noreturn) differs
1212
13+
## Remarks
14+
1315
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`.
1416

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

1721
```cpp

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ ms.assetid: 4d4436f9-d0d6-4bd0-b8ec-767b89adfb2f
1010

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

15+
This error indicates that a function overload was attempted only on the [exception specification](../../cpp/exception-specifications-throw-cpp.md).
16+
1717
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.
1818

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

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 6696221d-879c-477a-a0f3-a6edc15fd3d7
1010

1111
> '*symbol*' : default-arguments are not allowed on this symbol
1212
13+
## Remarks
14+
1315
The C++ compiler does not allow default arguments on pointers to functions.
1416

1517
This code was accepted by the Microsoft C++ compiler in versions before Visual Studio 2005, but now gives an error. For code that works in all versions of Visual C++, do not assign a default value to a pointer-to-function argument.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: 8145f7ad-31b1-406d-ac43-0d557feab635
1010

1111
> 'member' : cannot apply __declspec(thread) to a member of a managed or WinRT class
1212
13+
## Remarks
14+
1315
The [thread](../../cpp/thread.md) **`__declspec`** modifier cannot be used on a member of a managed or Windows Runtime class.
1416

1517
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.
1618

19+
## Example
20+
1721
The following line generates C2384 and shows how to fix it in C++/CLI code:
1822

1923
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ helpviewer_keywords: ["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.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: aaaa1284-34a0-4da2-8547-9fcbb559dae0
1010

1111
> 'symbol' : a symbol with this name already exists in the current scope
1212
13+
## Remarks
14+
1315
You tried to create a namespace alias, but the name you chose already exists.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: 6847b8e1-ffac-458d-ab88-0c92f72f2527
1010

1111
> 'type' : ambiguous base class
1212
13+
## Remarks
14+
1315
The compiler could not unambiguously resolve a function call because the function exists in more than one base class.
1416

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

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

1923
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: 764ad2d7-cb04-425f-ba30-70989488c4a4
1010

1111
> 'symbol' : a symbol cannot be declared with both __declspec(appdomain) and \__declspec(process)
1212
13+
## Remarks
14+
1315
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.
1416

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

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

1923
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 6122dc81-4ee3-49a5-a67d-d867808c9bac
1010

1111
> 'operator' : illegal operand 'nullptr'
1212
13+
## Remarks
14+
1315
**`nullptr`** cannot be an operand.
1416

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

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 06b749ee-d072-4db1-b229-715f2c0728b5
1010

1111
> 'identifier' : incorrect storage class 'specifier'
1212
13+
## Remarks
14+
1315
The storage class is not valid for the global-scope identifier. The default storage class is used in place of the invalid class.
1416

1517
Possible resolutions:

0 commit comments

Comments
 (0)