diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2701.md b/docs/error-messages/compiler-errors-2/compiler-error-c2701.md index 7db2a0789f..6d038a0270 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2701.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2701.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2701" title: "Compiler Error C2701" +description: "Learn more about: Compiler Error C2701" ms.date: 09/27/2022 f1_keywords: ["C2701"] helpviewer_keywords: ["C2701"] -ms.assetid: 31cf2ab7-ced9-4f75-aa51-e169e20407fb --- # Compiler Error C2701 > 'function': a function template cannot be a `friend` of a local class +## Remarks + A local class can't have a function template as a `friend` function. -The following sample generates C2701: +## Example + +The following example generates C2701: ```cpp // C2701.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2702.md b/docs/error-messages/compiler-errors-2/compiler-error-c2702.md index 8ab3ce78de..d552a51215 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2702.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2702.md @@ -4,15 +4,18 @@ description: "Describes Microsoft C/C++ compiler error C2702." ms.date: 08/25/2020 f1_keywords: ["C2702"] helpviewer_keywords: ["C2702"] -ms.assetid: 6def15d4-9a8d-43e7-ae35-42d7cb57c27e --- # Compiler Error C2702 > `__except` may not appear in termination block +## Remarks + An exception handler (**`__try`**/**`__except`**) cannot be nested inside a **`__finally`** block. -The following sample generates C2702: +## Example + +The following example generates C2702: ```cpp // C2702.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2703.md b/docs/error-messages/compiler-errors-2/compiler-error-c2703.md index 113bf49c70..87adbc9051 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2703.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2703.md @@ -4,7 +4,6 @@ description: "Describes Microsoft C/C++ compiler error C2703." ms.date: 08/24/2020 f1_keywords: ["C2703"] helpviewer_keywords: ["C2703"] -ms.assetid: 384295c3-643d-47ae-a9a6-865b3036aa84 --- # Compiler Error C2703 @@ -16,7 +15,7 @@ A **`__leave`** statement must be inside a **`__try`** block. ## Example -The following sample generates C2703: +The following example generates C2703: ```cpp // C2703.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2704.md b/docs/error-messages/compiler-errors-2/compiler-error-c2704.md index 476dd46228..4d231d20a9 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2704.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2704.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2704" title: "Compiler Error C2704" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2704" +ms.date: 11/04/2016 f1_keywords: ["C2704"] helpviewer_keywords: ["C2704"] -ms.assetid: 185797e2-55b5-4c11-8493-e70eb1d15a94 --- # Compiler Error C2704 -'identifier' : __va_start intrinsic only allowed in varargs +> 'identifier' : __va_start intrinsic only allowed in varargs + +## Remarks The `__va_start` intrinsic is used in a declaration for a function with a fixed number of arguments. diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2705.md b/docs/error-messages/compiler-errors-2/compiler-error-c2705.md index 39fdf0029a..d080e7a213 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2705.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2705.md @@ -4,7 +4,6 @@ description: "Describes Microsoft C/C++ compiler error C2705." ms.date: 08/25/2020 f1_keywords: ["C2705"] helpviewer_keywords: ["C2705"] -ms.assetid: 29249ea3-4ea7-4105-944b-bdb83e8d6852 --- # Compiler Error C2705 @@ -16,7 +15,7 @@ Execution jumps to a label within a **`try`**/**`catch`**, **`__try`**/**`__exce ## Example -The following sample generates C2705: +The following example generates C2705: ```cpp // C2705.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2706.md b/docs/error-messages/compiler-errors-2/compiler-error-c2706.md index c21375885e..0490d7807c 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2706.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2706.md @@ -4,15 +4,18 @@ description: "Describes Microsoft C/C++ compiler error C2706." ms.date: 08/25/2020 f1_keywords: ["C2706"] helpviewer_keywords: ["C2706"] -ms.assetid: e18da924-c42d-4b09-8e29-f4e0382d7dc6 --- # Compiler Error C2706 > illegal `__except` without matching `__try` (missing '}' in `__try` block?) +## Remarks + The compiler did not find a closing brace for a **`__try`** block. -The following sample generates C2706: +## Example + +The following example generates C2706: ```cpp // C2706.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2707.md b/docs/error-messages/compiler-errors-2/compiler-error-c2707.md index ff081cdf34..3bfc8a90ae 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2707.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2707.md @@ -1,14 +1,15 @@ --- -description: "Learn more about: Compiler Error C2707" title: "Compiler Error C2707" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2707" +ms.date: 11/04/2016 f1_keywords: ["C2707"] helpviewer_keywords: ["C2707"] -ms.assetid: 3deaf45c-74da-4c9d-acc6-b82412720b74 --- # Compiler Error C2707 -'identifier' : bad context for intrinsic function +> 'identifier' : bad context for intrinsic function + +## Remarks Structured exception-handling intrinsics are invalid in certain contexts: @@ -22,7 +23,7 @@ To resolve the error, be sure that the exception-handling intrinsics are placed ## Example -The following sample generates C2707. +The following example generates C2707. ```cpp // C2707.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2708.md b/docs/error-messages/compiler-errors-2/compiler-error-c2708.md index 72031e762a..a8b2f3d650 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2708.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2708.md @@ -1,14 +1,15 @@ --- -description: "Learn more about: Compiler Error C2708" title: "Compiler Error C2708" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2708" +ms.date: 11/04/2016 f1_keywords: ["C2708"] helpviewer_keywords: ["C2708"] -ms.assetid: d52d3088-1141-42f4-829c-74755a7fcc3a --- # Compiler Error C2708 -'identifier' : actual parameters length in bytes differs from previous call or reference +> 'identifier' : actual parameters length in bytes differs from previous call or reference + +## Remarks A [__stdcall](../../cpp/stdcall.md) function must be preceded by a prototype. Otherwise, the compiler interprets the first call to the function as a prototype and this error occurs when the compiler encounters a call that does not match. diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2709.md b/docs/error-messages/compiler-errors-2/compiler-error-c2709.md index 8412aaff02..36a2376616 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2709.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2709.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2709" title: "Compiler Error C2709" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2709" +ms.date: 11/04/2016 f1_keywords: ["C2709"] helpviewer_keywords: ["C2709"] -ms.assetid: e66fc7e6-0e91-4b99-a6e0-fdb069b09fbc --- # Compiler Error C2709 -'identifier' : formal parameter's length in bytes differs from previous declaration +> 'identifier' : formal parameter's length in bytes differs from previous declaration + +## Remarks The signature in a call to the specified function differs from the prototype. diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2710.md b/docs/error-messages/compiler-errors-2/compiler-error-c2710.md index 5b2ddea861..3019c67c1c 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2710.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2710.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2710" title: "Compiler Error C2710" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2710" +ms.date: 11/04/2016 f1_keywords: ["C2710"] helpviewer_keywords: ["C2710"] -ms.assetid: a2a6bb5b-86ad-4a6c-acd0-e2bef8464e0e --- # Compiler Error C2710 -'construct' : '__declspec(modifier)' can only be applied to a function returning a pointer +> 'construct' : '__declspec(modifier)' can only be applied to a function returning a pointer + +## Remarks A function whose return value is a pointer is the only construct to which `modifier` can be applied. -The following sample generates C2710: +## Example + +The following example generates C2710: ```cpp // C2710.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2711.md b/docs/error-messages/compiler-errors-2/compiler-error-c2711.md index 137e67e933..a0b44f3827 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2711.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2711.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2711" title: "Compiler Error C2711" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2711" +ms.date: 11/04/2016 f1_keywords: ["C2711"] helpviewer_keywords: ["C2711"] -ms.assetid: 9df9f808-7419-4e63-abdd-e6538ff0871f --- # Compiler Error C2711 -'function' : this function cannot be compiled as managed, consider using #pragma unmanaged +> 'function' : this function cannot be compiled as managed, consider using #pragma unmanaged + +## Remarks Some instructions will prevent the compiler from generating MSIL for the enclosing function. -The following sample generates C2711: +## Example + +The following example generates C2711: ```cpp // C2711.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2712.md b/docs/error-messages/compiler-errors-2/compiler-error-c2712.md index 8b1b715cb0..b1caf1ca2d 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2712.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2712.md @@ -4,7 +4,6 @@ description: "Describes Microsoft C/C++ compiler error C2712." ms.date: 08/25/2020 f1_keywords: ["C2712"] helpviewer_keywords: ["C2712"] -ms.assetid: f7d4ffcc-7ed2-459b-8067-a728ce647071 --- # Compiler Error C2712 @@ -30,7 +29,7 @@ The **`/clr:pure`** and **`/clr:safe`** compiler options are deprecated in Visua ## Example -The following sample generates C2712 and shows how to fix it. +The following example generates C2712 and shows how to fix it. ```cpp // C2712.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2713.md b/docs/error-messages/compiler-errors-2/compiler-error-c2713.md index 59ee0bf0a9..65eeed13bd 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2713.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2713.md @@ -4,10 +4,11 @@ description: "Describes Microsoft C/C++ compiler error C2713." ms.date: 08/25/2020 f1_keywords: ["C2713"] helpviewer_keywords: ["C2713"] -ms.assetid: bae9bee3-b4b8-4be5-b6a5-02df587a7278 --- # Compiler Error C2713 > only one form of exception handling permitted per function +## Remarks + You can't use structured exception handling (**`__try`**/**`__except`**) and C++ exception handling (**`try`**/**`catch`**) in the same function. diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2714.md b/docs/error-messages/compiler-errors-2/compiler-error-c2714.md index 95d86859dc..c876015451 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2714.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2714.md @@ -1,24 +1,23 @@ --- -description: "Learn more about: Compiler Error C2714" title: "Compiler Error C2714" +description: "Learn more about: Compiler Error C2714" ms.date: 07/22/2020 f1_keywords: ["C2714"] helpviewer_keywords: ["C2714"] -ms.assetid: 401a5a42-660c-4bad-9d63-1a2d092bc489 --- # Compiler Error C2714 > `alignof(void)` is not allowed -An invalid value was passed to an operator. - ## Remarks +An invalid value was passed to an operator. + See [`alignof` operator](../../cpp/alignof-operator.md) for more information. ## Example -The following sample generates C2714. +The following example generates C2714. ```cpp // C2714.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2715.md b/docs/error-messages/compiler-errors-2/compiler-error-c2715.md index 1321f85ca9..ddb31bc681 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2715.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2715.md @@ -1,17 +1,22 @@ --- -description: "Learn more about: Compiler Error C2715" title: "Compiler Error C2715" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2715" +ms.date: 11/04/2016 f1_keywords: ["C2715"] helpviewer_keywords: ["C2715"] -ms.assetid: c81567a7-5b65-468f-aaf9-835f91e468e4 --- # Compiler Error C2715 -'type' : cannot throw or catch this type +> 'type' : cannot throw or catch this type + +## Remarks Value types are not valid arguments when using exception handling in managed code (see [Exception Handling](../../extensions/exception-handling-cpp-component-extensions.md) for more information). +## Example + +The following example generates C2715 and shows how to fix it: + ```cpp // C2715a.cpp // compile with: /clr diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2718.md b/docs/error-messages/compiler-errors-2/compiler-error-c2718.md index 6b67c1f933..180afef6ea 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2718.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2718.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2718" title: "Compiler Error C2718" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2718" +ms.date: 11/04/2016 f1_keywords: ["C2718"] helpviewer_keywords: ["C2718"] -ms.assetid: 78cc71f8-c142-46fc-9aed-970635d74f0c --- # Compiler Error C2718 -'parameter': actual parameter with __declspec(align('#')) won't be aligned +> 'parameter': actual parameter with __declspec(align('#')) won't be aligned + +## Remarks The [align](../../cpp/align-cpp.md) **`__declspec`** modifier is not permitted on function parameters. -The following sample generates C2718: +## Example + +The following example generates C2718: ```cpp // C2718.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2719.md b/docs/error-messages/compiler-errors-2/compiler-error-c2719.md index 3b367a25ba..6df11d9414 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2719.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2719.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2719" title: "Compiler Error C2719" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2719" +ms.date: 11/04/2016 f1_keywords: ["C2719"] helpviewer_keywords: ["C2719"] -ms.assetid: ea6236d3-8286-45cc-9478-c84ad3dd3c8e --- # Compiler Error C2719 -'parameter': formal parameter with __declspec(align('#')) won't be aligned +> 'parameter': formal parameter with __declspec(align('#')) won't be aligned + +## Remarks The [align](../../cpp/align-cpp.md) **`__declspec`** modifier is not permitted on function parameters. Function parameter alignment is controlled by the calling convention used. For more information, see [Calling Conventions](../../cpp/calling-conventions.md). -The following sample generates C2719 and shows how to fix it: +## Example + +The following example generates C2719 and shows how to fix it: ```cpp // C2719.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2720.md b/docs/error-messages/compiler-errors-2/compiler-error-c2720.md index 40b1afaa4e..66fd999f7a 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2720.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2720.md @@ -1,20 +1,21 @@ --- -description: "Learn more about: Compiler Error C2720" title: "Compiler Error C2720" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2720" +ms.date: 11/04/2016 f1_keywords: ["C2720"] helpviewer_keywords: ["C2720"] -ms.assetid: 9ee3aab7-711b-4f5a-b2f1-cb62b130f1ce --- # Compiler Error C2720 > '*identifier*' : '*specifier*' storage-class specifier illegal on members +## Remarks + The storage class cannot be used on class members outside the declaration. To fix this error, remove the unneeded [storage class](../../cpp/storage-classes-cpp.md) specifier from the definition of the member outside the class declaration. ## Example -The following sample generates C2720 and shows how to fix it: +The following example generates C2720 and shows how to fix it: ```cpp // C2720.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2721.md b/docs/error-messages/compiler-errors-2/compiler-error-c2721.md index 0bafc693b2..2bfd272ae2 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2721.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2721.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2721" title: "Compiler Error C2721" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2721" +ms.date: 11/04/2016 f1_keywords: ["C2721"] helpviewer_keywords: ["C2721"] -ms.assetid: 7a97823c-3ce1-4112-8253-fc1448685235 --- # Compiler Error C2721 -'specifier' : storage-class specifier illegal between operator keyword and type +> 'specifier' : storage-class specifier illegal between operator keyword and type + +## Remarks User-defined type conversions apply to all storage classes, so you cannot specify a storage class in a type conversion. diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2722.md b/docs/error-messages/compiler-errors-2/compiler-error-c2722.md index 0240cca6d4..892e345c5c 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2722.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2722.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2722" title: "Compiler Error C2722" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2722" +ms.date: 11/04/2016 f1_keywords: ["C2722"] helpviewer_keywords: ["C2722"] -ms.assetid: 4cc2c7fa-cb12-4bcf-9df1-6d627ef62973 --- # Compiler Error C2722 -'::operator' : illegal following operator command; use 'operator operator' +> '::operator' : illegal following operator command; use 'operator operator' + +## Remarks An `operator` statement redefines `::new` or `::delete`. The `new` and `delete` operators are global, so the scope resolution operator (`::`) is meaningless. Remove the `::` operator. diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2723.md b/docs/error-messages/compiler-errors-2/compiler-error-c2723.md index 48dad9d850..b878410fa1 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2723.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2723.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2723" title: "Compiler Error C2723" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2723" +ms.date: 11/04/2016 f1_keywords: ["C2723"] helpviewer_keywords: ["C2723"] -ms.assetid: 86925601-2297-4cfd-94e2-2caf27c474c4 --- # Compiler Error C2723 -'function' : 'specifier' specifier illegal on function definition +> 'function' : 'specifier' specifier illegal on function definition + +## Remarks The specifier cannot appear with a function definition outside of a class declaration. The **`virtual`** specifier can be specified only on a member function declaration within a class declaration. -The following sample generates C2723 and shows how to fix it: +## Example + +The following example generates C2723 and shows how to fix it: ```cpp // C2723.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2724.md b/docs/error-messages/compiler-errors-2/compiler-error-c2724.md index 8860220e66..21e3b41693 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2724.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2724.md @@ -7,11 +7,15 @@ helpviewer_keywords: ["C2724"] --- # Compiler Error C2724 -'identifier' : 'static' should not be used on member functions defined at file scope +> 'identifier' : 'static' should not be used on member functions defined at file scope + +## Remarks Static member functions should be declared with external linkage. -The following sample generates C2724: +## Example + +The following example generates C2724: ```cpp // C2724.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2725.md b/docs/error-messages/compiler-errors-2/compiler-error-c2725.md index b362cad13e..ef72d45e28 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2725.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2725.md @@ -1,20 +1,21 @@ --- -description: "Learn more about: Compiler Error C2725" title: "Compiler Error C2725" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2725" +ms.date: 11/04/2016 f1_keywords: ["C2725"] helpviewer_keywords: ["C2725"] -ms.assetid: 13cd5b1b-e906-4cd8-9b2b-510d587c665a --- # Compiler Error C2725 -'exception' : unable to throw or catch a managed or WinRT object by value or reference +> 'exception' : unable to throw or catch a managed or WinRT object by value or reference + +## Remarks The type of a managed or WinRT exception was not correct. ## Examples -The following sample generates C2725 and shows how to fix it. +The following example generates C2725 and shows how to fix it. ```cpp // C2725.cpp @@ -33,7 +34,7 @@ int main() { } ``` -The following sample generates C2725 and shows how to fix it. +The following example generates C2725 and shows how to fix it. ```cpp // C2725b.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2726.md b/docs/error-messages/compiler-errors-2/compiler-error-c2726.md index 1cf7c3f939..22aa1b5240 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2726.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2726.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2726" title: "Compiler Error C2726" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2726" +ms.date: 11/04/2016 f1_keywords: ["C2726"] helpviewer_keywords: ["C2726"] -ms.assetid: f0191bb7-c175-450b-bf09-a3213db96d09 --- # Compiler Error C2726 -'gcnew' may only be used to create an object with managed or WinRT type +> 'gcnew' may only be used to create an object with managed or WinRT type + +## Remarks You cannot create an instance of a native type on the garbage-collected heap. -The following sample generates C2726 and shows how to fix it: +## Example + +The following example generates C2726 and shows how to fix it: ```cpp // C2726.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2728.md b/docs/error-messages/compiler-errors-2/compiler-error-c2728.md index 79660264d0..8300ece356 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2728.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2728.md @@ -1,20 +1,23 @@ --- -description: "Learn more about: Compiler Error C2728" title: "Compiler Error C2728" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2728" +ms.date: 11/04/2016 f1_keywords: ["C2728"] helpviewer_keywords: ["C2728"] -ms.assetid: 65635f91-1cd1-46e4-9ad7-14726d0546af --- # Compiler Error C2728 -'type' : a native array cannot contain this type +> 'type' : a native array cannot contain this type + +## Remarks Array creation syntax was used to create an array of managed or WinRT objects. You cannot create an array of managed or WinRT objects using native array syntax. For more information, see [array](../../extensions/arrays-cpp-component-extensions.md). -The following sample generates C2728 and shows how to fix it: +## Example + +The following example generates C2728 and shows how to fix it: ```cpp // C2728.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2730.md b/docs/error-messages/compiler-errors-2/compiler-error-c2730.md index b7a014e42c..f06cf3b7fe 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2730.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2730.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2730" title: "Compiler Error C2730" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2730" +ms.date: 11/04/2016 f1_keywords: ["C2730"] helpviewer_keywords: ["C2730"] -ms.assetid: 07f0b17a-bc8e-4d79-af5a-07a07af3687b --- # Compiler Error C2730 -'class' : cannot be a base class of itself +> 'class' : cannot be a base class of itself + +## Remarks Recursive base classes are invalid. Specify another class as the base class.