Skip to content

Commit bb45a4b

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C3251, C3280]
1 parent 8736f5b commit bb45a4b

20 files changed

+72
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 541c163e-5ee9-457c-a1e5-da860788b10d
1010

1111
> cannot invoke base class method on a value type instance
1212
13+
## Remarks
14+
1315
The following error occurs because `GetClass` is a member of `Microsoft.Runtime.Object`, not of `Microsoft.Runtime.Integer4`.
1416

1517
This error is obsolete in Visual Studio 2022 and later versions.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: aa9ad096-e9ac-41c7-8ad9-b966751c7c75
1010

1111
> 'method' : cannot reduce accessibility of a virtual method in a managed or WinRT type
1212
13+
## Remarks
14+
1315
A class that implements a virtual method from a base class or any method from an interface cannot reduce the access of that method.
1416

1517
Note that all methods in an interface are public.
1618

19+
## Example
20+
1721
The following sample generates C3252 and shows how to fix it:
1822

1923
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: da40be26-0f78-4730-8727-ad11cddf8869
1010

1111
> 'function' : error with explicit override
1212
13+
## Remarks
14+
1315
An explicit override was specified incorrectly. For example, you cannot specify an implementation for an override that you also specify as pure. For more information, see [Explicit Overrides](../../extensions/explicit-overrides-cpp-component-extensions.md).
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 93427b10-fa72-4e43-80d1-1a6e122f9f40
1010

1111
> 'explicit override' : class contains explicit override 'override' but does not derive from an interface that contains the function declaration
1212
13+
## Remarks
14+
1315
When you [explicitly override](../../cpp/explicit-overrides-cpp.md) a method, the class that contains the override must derive, directly or indirectly, from the type that contains the function you are overriding.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 877ffca2-fd92-44b6-9060-6091b928b1c1
1010

1111
> 'value type' : cannot dynamically allocate this value type object on native heap
1212
13+
## Remarks
14+
1315
Instances of a value type (see [Classes and Structs](../../extensions/classes-and-structs-cpp-component-extensions.md)) that contain managed members can be created on the stack but not on the heap.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 3e74b9aa-de3c-4492-9331-ee73012b958b
1010

1111
> invalid array indexing: '#' dimension(s) specified for '#'-dimensional 'array type'
1212
13+
## Remarks
14+
1315
An array was improperly subscripted. The number of indices may not match the number of dimensions in the array.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 94ece687-2364-4f7a-8ebb-7afd3ae9d63d
1010

1111
> 'class' : a class-constructor cannot have a return type
1212
13+
## Remarks
14+
1315
Class constructors cannot have return types.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 10ab3e17-4a9f-4120-bab5-21473869b70f
1010

1111
> cannot declare a managed 'managed construct' in an unmanaged 'unmanaged construct'
1212
13+
## Remarks
14+
1315
You cannot include a managed object in an unmanaged context.
1416

17+
## Example
18+
1519
The following sample reproduces C3265:
1620

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 7375c099-acb7-42f6-898d-57cfefa010b8
1010

1111
> 'class' : a class-constructor must have a 'void' parameter list
1212
13+
## Remarks
14+
1315
Class-constructors in a class using /clr programming cannot take parameters.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: c575f067-244d-4dd5-bf58-9e7630ea58b7
1010

1111
> 'function' : a member-function of a managed or WinRTtype cannot be declared with '...'
1212
13+
## Remarks
14+
1315
Managed and WinRT class member functions cannot declare variable-length parameter lists.
1416

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

1721
```cpp

0 commit comments

Comments
 (0)