Skip to content

Commit f828f78

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C3381, C3420]
1 parent 5ad0e14 commit f828f78

27 files changed

+71
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ ms.assetid: d276c89f-8377-4cb6-a8d4-7770885f06c4
1010

1111
> '*identifier*' : assembly access specifiers are only available in code compiled with a /clr option
1212
13-
A type was declared or defined by using an access specifier, which is only permitted in code compiled by using **`/clr`**.
14-
1513
## Remarks
1614

15+
A type was declared or defined by using an access specifier, which is only permitted in code compiled by using **`/clr`**.
16+
1717
This error may result from a misplaced **`public`**, **`protected`**, or **`private`** keyword, or a missing colon (**`:`**) after an access specifier within a **`class`** or **`struct`**.
1818

1919
In C++/CLI, native types can be visible outside an assembly, but you can only specify assembly access for native types in a **`/clr`** compilation. For more information, see [Type visibility](../../dotnet/how-to-define-and-consume-classes-and-structs-cpp-cli.md#BKMK_Type_visibility) and [`/clr` (Common Language Runtime Compilation)](../../build/reference/clr-common-language-runtime-compilation.md).

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: a7603abd-ac4e-4ae6-a02b-3bdc6d1908a6
1010

1111
> 'sizeof' is not supported with /clr:safe
1212
13+
## Remarks
14+
1315
The output file of a **/clr:safe** compilation is a file that is verifiably type safe, and sizeof is not supported because the return value of the sizeof operator is size_t, whose size varies depending on the operating system.
1416

1517
For more information, see,

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: ceb7f725-f417-4dc3-8496-0f413bb76687
1010

1111
> 'operator new' is not supported with /clr:safe
1212
13+
## Remarks
14+
1315
The output file of a **/clr:safe** compilation is a file that is verifiably type safe, and pointers are not supported.
1416

1517
For more information, see,

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: c9f92c6a-62a9-4333-b2b1-bc55c7f288b6
1010

1111
> 'type_parameter' : the value constraint and the ref constraint are mutually exclusive
1212
13+
## Remarks
14+
1315
You cannot constrain a generic type to both **`value class`** and **`ref class`**.
1416

1517
See [Constraints on Generic Type Parameters (C++/CLI)](../../extensions/constraints-on-generic-type-parameters-cpp-cli.md) for more information.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 5f1838c1-986e-47db-8dbc-e06976b83cf3
1010

1111
> 'class::function' : a function that has a DllImport Custom attribute cannot return an instance of a class
1212
13+
## Remarks
14+
1315
A function defined as being in a .dll file specified with the `DllImport` attribute cannot return an instance of a class.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 93fa8c33-0f10-402b-8eec-b0a217a1f8dc
1010

1111
> '*type-name*' : `__declspec(dllexport)`/`__declspec(dllimport)` cannot be applied to a managed or WinRT type
1212
13+
## Remarks
14+
1315
The [`dllimport`](../../cpp/dllexport-dllimport.md) and [`dllexport`](../../cpp/dllexport-dllimport.md) **`__declspec`** modifiers aren't valid on a managed or Windows Runtime type.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: c54d9925-ed14-4976-b8db-e8d4dc84e536
1010

1111
> 'member' : __declspec(dllexport)/\__declspec(dllimport) cannot be applied to a member of a managed or WinRT type
1212
13+
## Remarks
14+
1315
The `dllimport` and [dllexport](../../cpp/dllexport-dllimport.md) **`__declspec`** modifiers are not valid on members of a managed or Windows Runtime type.
1416

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

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 34336545-ed13-4d81-ab5f-f869799fe4c2
1010

1111
> 'type' : not allowed as a constraint, assuming 'ref class' to continue parsing
1212
13+
## Remarks
14+
1315
A constraint was specified on a generic type, but the constraint was not specified correctly. See [Constraints on Generic Type Parameters (C++/CLI)](../../extensions/constraints-on-generic-type-parameters-cpp-cli.md) for more information.
1416

1517
## Example

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ ms.assetid: 84800a87-c8e6-45aa-82ae-02f816dc8d97
1010

1111
> '*type_arg*' : invalid type argument for generic parameter '*param*' of generic '*generic_type*', must be a reference type
1212
13-
A generic type was instantiated incorrectly. Check the type definition.
14-
1513
## Remarks
1614

15+
A generic type was instantiated incorrectly. Check the type definition.
16+
1717
For more information, see [Generics](../../extensions/generics-cpp-component-extensions.md).
1818

1919
## Example

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: c32532b9-7db4-4ccd-84b9-479e5a1a19d1
1010

1111
> 'type_arg' : invalid type argument for generic parameter 'param' of generic 'generic_type', must be a non-nullable value type
1212
13+
## Remarks
14+
1315
A generic type was instantiated incorrectly. Check the type definition. For more information, see <xref:System.Nullable> and [Generics](../../extensions/generics-cpp-component-extensions.md).
1416

1517
## Example

0 commit comments

Comments
 (0)