diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3251.md b/docs/error-messages/compiler-errors-2/compiler-error-c3251.md index 8756c4429d..ff7203c63a 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3251.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3251.md @@ -1,15 +1,16 @@ --- -description: "Learn more about: Compiler Error C3251" title: "Compiler Error C3251" +description: "Learn more about: Compiler Error C3251" ms.date: 06/01/2022 f1_keywords: ["C3251"] helpviewer_keywords: ["C3251"] -ms.assetid: 541c163e-5ee9-457c-a1e5-da860788b10d --- # Compiler Error C3251 > cannot invoke base class method on a value type instance +## Remarks + The following error occurs because `GetClass` is a member of `Microsoft.Runtime.Object`, not of `Microsoft.Runtime.Integer4`. This error is obsolete in Visual Studio 2022 and later versions. diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3252.md b/docs/error-messages/compiler-errors-2/compiler-error-c3252.md index 979108c12a..0313cb3e10 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3252.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3252.md @@ -1,20 +1,23 @@ --- -description: "Learn more about: Compiler Error C3252" title: "Compiler Error C3252" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3252" +ms.date: 11/04/2016 f1_keywords: ["C3252"] helpviewer_keywords: ["C3252"] -ms.assetid: aa9ad096-e9ac-41c7-8ad9-b966751c7c75 --- # Compiler Error C3252 -'method' : cannot reduce accessibility of a virtual method in a managed or WinRT type +> 'method' : cannot reduce accessibility of a virtual method in a managed or WinRT type + +## Remarks A class that implements a virtual method from a base class or any method from an interface cannot reduce the access of that method. Note that all methods in an interface are public. -The following sample generates C3252 and shows how to fix it: +## Example + +The following example generates C3252 and shows how to fix it: ```cpp // C3252.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3253.md b/docs/error-messages/compiler-errors-2/compiler-error-c3253.md index 789a18bd23..3fc664e8ad 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3253.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3253.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3253" title: "Compiler Error C3253" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3253" +ms.date: 11/04/2016 f1_keywords: ["C3253"] helpviewer_keywords: ["C3253"] -ms.assetid: da40be26-0f78-4730-8727-ad11cddf8869 --- # Compiler Error C3253 -'function' : error with explicit override +> 'function' : error with explicit override + +## Remarks 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). -The following sample generates C3253: +## Example + +The following example generates C3253: ```cpp // C3253.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3254.md b/docs/error-messages/compiler-errors-2/compiler-error-c3254.md index 8d7f4685f9..564020dfaf 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3254.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3254.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3254" title: "Compiler Error C3254" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3254" +ms.date: 11/04/2016 f1_keywords: ["C3254"] helpviewer_keywords: ["C3254"] -ms.assetid: 93427b10-fa72-4e43-80d1-1a6e122f9f40 --- # Compiler Error C3254 -'explicit override' : class contains explicit override 'override' but does not derive from an interface that contains the function declaration +> 'explicit override' : class contains explicit override 'override' but does not derive from an interface that contains the function declaration + +## Remarks 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. -The following sample generates C3254: +## Example + +The following example generates C3254: ```cpp // C3254.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3255.md b/docs/error-messages/compiler-errors-2/compiler-error-c3255.md index 5e2b71a853..85780e5caf 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3255.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3255.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3255" title: "Compiler Error C3255" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3255" +ms.date: 11/04/2016 f1_keywords: ["C3255"] helpviewer_keywords: ["C3255"] -ms.assetid: 877ffca2-fd92-44b6-9060-6091b928b1c1 --- # Compiler Error C3255 -'value type' : cannot dynamically allocate this value type object on native heap +> 'value type' : cannot dynamically allocate this value type object on native heap + +## Remarks 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. -The following sample generates C3255: +## Example + +The following example generates C3255: ```cpp // C3255.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3262.md b/docs/error-messages/compiler-errors-2/compiler-error-c3262.md index aeff907ea7..a03b9b5675 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3262.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3262.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3262" title: "Compiler Error C3262" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3262" +ms.date: 11/04/2016 f1_keywords: ["C3262"] helpviewer_keywords: ["C3262"] -ms.assetid: 3e74b9aa-de3c-4492-9331-ee73012b958b --- # Compiler Error C3262 -invalid array indexing: '#' dimension(s) specified for '#'-dimensional 'array type' +> invalid array indexing: '#' dimension(s) specified for '#'-dimensional 'array type' + +## Remarks An array was improperly subscripted. The number of indices may not match the number of dimensions in the array. -The following sample generates C3262: +## Example + +The following example generates C3262: ```cpp // C3262.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3264.md b/docs/error-messages/compiler-errors-2/compiler-error-c3264.md index 2f620f5985..67246af20c 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3264.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3264.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3264" title: "Compiler Error C3264" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3264" +ms.date: 11/04/2016 f1_keywords: ["C3264"] helpviewer_keywords: ["C3264"] -ms.assetid: 94ece687-2364-4f7a-8ebb-7afd3ae9d63d --- # Compiler Error C3264 -'class' : a class-constructor cannot have a return type +> 'class' : a class-constructor cannot have a return type + +## Remarks Class constructors cannot have return types. -The following sample generates C3264: +## Example + +The following example generates C3264: ```cpp // C3264_2.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3265.md b/docs/error-messages/compiler-errors-2/compiler-error-c3265.md index c1b01d64d2..0a42b012bb 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3265.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3265.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3265" title: "Compiler Error C3265" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3265" +ms.date: 11/04/2016 f1_keywords: ["C3265"] helpviewer_keywords: ["C3265"] -ms.assetid: 10ab3e17-4a9f-4120-bab5-21473869b70f --- # Compiler Error C3265 -cannot declare a managed 'managed construct' in an unmanaged 'unmanaged construct' +> cannot declare a managed 'managed construct' in an unmanaged 'unmanaged construct' + +## Remarks You cannot include a managed object in an unmanaged context. -The following sample reproduces C3265: +## Example + +The following example reproduces C3265: ```cpp // C3265_2.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3266.md b/docs/error-messages/compiler-errors-2/compiler-error-c3266.md index 80ca7c50aa..74c180fce4 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3266.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3266.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3266" title: "Compiler Error C3266" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3266" +ms.date: 11/04/2016 f1_keywords: ["C3266"] helpviewer_keywords: ["C3266"] -ms.assetid: 7375c099-acb7-42f6-898d-57cfefa010b8 --- # Compiler Error C3266 -'class' : a class-constructor must have a 'void' parameter list +> 'class' : a class-constructor must have a 'void' parameter list + +## Remarks Class-constructors in a class using /clr programming cannot take parameters. -The following sample generates C3266: +## Example + +The following example generates C3266: ```cpp // C3266.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3268.md b/docs/error-messages/compiler-errors-2/compiler-error-c3268.md index f58d77ec0d..48c86a4db5 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3268.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3268.md @@ -1,10 +1,9 @@ --- -description: "Learn more about: Compiler Error C3268" title: "Compiler Error C3268" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3268" +ms.date: 11/04/2016 f1_keywords: ["C3268"] helpviewer_keywords: ["C3268"] -ms.assetid: d74a630c-daea-4e29-9759-83efef7fb184 --- # Compiler Error C3268 @@ -18,7 +17,7 @@ See [Generics](../../extensions/generics-cpp-component-extensions.md) for more i ## Example -The following sample generates C3268. +The following example generates C3268. ```cpp // C3268.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3269.md b/docs/error-messages/compiler-errors-2/compiler-error-c3269.md index 30e3769f27..dda026a75a 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3269.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3269.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3269" title: "Compiler Error C3269" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3269" +ms.date: 11/04/2016 f1_keywords: ["C3269"] helpviewer_keywords: ["C3269"] -ms.assetid: c575f067-244d-4dd5-bf58-9e7630ea58b7 --- # Compiler Error C3269 -'function' : a member-function of a managed or WinRTtype cannot be declared with '...' +> 'function' : a member-function of a managed or WinRTtype cannot be declared with '...' + +## Remarks Managed and WinRT class member functions cannot declare variable-length parameter lists. -The following sample generates C3269 and shows how to fix it: +## Example + +The following example generates C3269 and shows how to fix it: ```cpp // C3269_2.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3270.md b/docs/error-messages/compiler-errors-2/compiler-error-c3270.md index 1fbce5730d..67d801e048 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3270.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3270.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3270" title: "Compiler Error C3270" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3270" +ms.date: 11/04/2016 f1_keywords: ["C3270"] helpviewer_keywords: ["C3270"] -ms.assetid: 70e6e76b-7415-48f5-a61e-2ed50caf08e4 --- # Compiler Error C3270 -'field': the FieldOffset attribute can only be used in the context of StructLayout(Explicit), in which case it is required +> 'field': the FieldOffset attribute can only be used in the context of StructLayout(Explicit), in which case it is required + +## Remarks A field was marked with **FieldOffset**, which is only allowed when **StructLayout(Explicit)** is in effect. -The following sample generates C3270: +## Example + +The following example generates C3270: ```cpp // C3270_2.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3271.md b/docs/error-messages/compiler-errors-2/compiler-error-c3271.md index 13e5aa3832..d40c824e59 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3271.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3271.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3271" title: "Compiler Error C3271" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3271" +ms.date: 11/04/2016 f1_keywords: ["C3271"] helpviewer_keywords: ["C3271"] -ms.assetid: 16d8bd1d-2e30-4c6a-a07f-0c4f3342fab5 --- # Compiler Error C3271 -'member': invalid value 'value' for the FieldOffset attribute +> 'member': invalid value 'value' for the FieldOffset attribute + +## Remarks A negative number was passed to the **FieldOffset** attribute. -The following sample generates C3271: +## Example + +The following example generates C3271: ```cpp // C3271.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3272.md b/docs/error-messages/compiler-errors-2/compiler-error-c3272.md index 6431d6dcf5..6cdc82dc54 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3272.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3272.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3272" title: "Compiler Error C3272" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3272" +ms.date: 11/04/2016 f1_keywords: ["C3272"] helpviewer_keywords: ["C3272"] -ms.assetid: 7cdf254d-f207-4116-a1bf-7386f3b82a6f --- # Compiler Error C3272 -'symbol' : symbol requires FieldOffset, as it is a member of type typename defined with StructLayout(LayoutKind::Explicit) +> 'symbol' : symbol requires FieldOffset, as it is a member of type typename defined with StructLayout(LayoutKind::Explicit) + +## Remarks When `StructLayout(LayoutKind::Explicit)` is in effect, fields must be marked with `FieldOffset`. -The following sample generates C3272: +## Example + +The following example generates C3272: ```cpp // C3272_2.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3273.md b/docs/error-messages/compiler-errors-2/compiler-error-c3273.md index c1d5a9f680..c19397dfa9 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3273.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3273.md @@ -1,16 +1,17 @@ --- -description: "Learn more about: Compiler Error C3273" title: "Compiler Error C3273" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3273" +ms.date: 11/04/2016 f1_keywords: ["C3273"] helpviewer_keywords: ["C3273"] -ms.assetid: 1d2ce9d9-222b-4cab-94e2-d2c1a9f5ebe0 --- # Compiler Error C3273 -__finally cannot be used on an exception block in unmanaged code. +> __finally cannot be used on an exception block in unmanaged code. + +## Example -The following sample generates C3273: +The following example generates C3273: ```cpp // C3273.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3274.md b/docs/error-messages/compiler-errors-2/compiler-error-c3274.md index b3732ce47a..59a9dfa237 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3274.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3274.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3274" title: "Compiler Error C3274" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3274" +ms.date: 11/04/2016 f1_keywords: ["C3274"] helpviewer_keywords: ["C3274"] -ms.assetid: 1f03f18e-b569-48eb-9249-11c70122a305 --- # Compiler Error C3274 -__finally/finally without matching try +> __finally/finally without matching try + +## Remarks A [__finally](../../cpp/try-finally-statement.md) or [finally](../../dotnet/finally.md) statement was found without a matching **`try`**. To resolve this, either delete the **`__finally`** statement or add a **`try`** statement for the **`__finally`**. -The following sample generates C3274: +## Example + +The following example generates C3274: ```cpp // C3274.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3275.md b/docs/error-messages/compiler-errors-2/compiler-error-c3275.md index ec6d61c49e..8164db7e72 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3275.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3275.md @@ -1,15 +1,16 @@ --- -description: "Learn more about: Compiler Error C3275" title: "Compiler Error C3275" +description: "Learn more about: Compiler Error C3275" ms.date: 06/01/2022 f1_keywords: ["C3275"] helpviewer_keywords: ["C3275"] -ms.assetid: 5752680f-7d3e-4c42-ba9c-845e09d32e7a --- # Compiler Error C3275 > 'enum member' : cannot use this symbol without qualifier +## Remarks + When using managed code and when two or more enumerations contain an identifier with the same name, you must explicitly qualify references to the identifier. C3275 is only reachable using the obsolete compiler option **`/clr:oldSyntax`**. It's not generated in Visual Studio 2022 or later versions. diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3276.md b/docs/error-messages/compiler-errors-2/compiler-error-c3276.md index 7734a6efa5..2acd2f4347 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3276.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3276.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C3276" title: "Compiler Error C3276" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3276" +ms.date: 11/04/2016 f1_keywords: ["C3276"] helpviewer_keywords: ["C3276"] -ms.assetid: dd6b4fd2-094d-4d34-a467-a9afd59789f7 --- # Compiler Error C3276 -'keyword' : jump out of __finally/finally block has undefined behavior during termination handling +> 'keyword' : jump out of __finally/finally block has undefined behavior during termination handling + +## Remarks This error is the same as the [C4532](../../error-messages/compiler-warnings/compiler-warning-level-1-c4532.md) warning. However, when you are using /clr, this condition cannot be disabled with the [warning](../../preprocessor/warning.md) pragma. diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3277.md b/docs/error-messages/compiler-errors-2/compiler-error-c3277.md index 5dda1f60f5..99686122c8 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3277.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3277.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3277" title: "Compiler Error C3277" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3277" +ms.date: 11/04/2016 f1_keywords: ["C3277"] helpviewer_keywords: ["C3277"] -ms.assetid: 8ac5f476-e30c-4879-92c6-f03cdbd74045 --- # Compiler Error C3277 -cannot define an unmanaged enum 'enum' inside managed 'type' +> cannot define an unmanaged enum 'enum' inside managed 'type' + +## Remarks An enumeration was defined incorrectly inside a managed type. -The following sample generates C3277: +## Example + +The following example generates C3277: ```cpp // C3277a.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3278.md b/docs/error-messages/compiler-errors-2/compiler-error-c3278.md index 633bd97241..4fa4676b8f 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3278.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3278.md @@ -1,10 +1,9 @@ --- -description: "Learn more about: Compiler Error C3278" title: "Compiler Error C3278" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3278" +ms.date: 11/04/2016 f1_keywords: ["C3278"] helpviewer_keywords: ["C3278"] -ms.assetid: 56f818f5-85a6-4792-843b-54fe16327658 --- # Compiler Error C3278 @@ -16,7 +15,7 @@ A call was made to an interface method or a pure method, which is not allowed. ## Example -The following sample generates C3278: +The following example generates C3278: ```cpp // C3278_2.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3279.md b/docs/error-messages/compiler-errors-2/compiler-error-c3279.md index ed97e7991d..2c8c603fab 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3279.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3279.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3279" title: "Compiler Error C3279" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3279" +ms.date: 11/04/2016 f1_keywords: ["C3279"] helpviewer_keywords: ["C3279"] -ms.assetid: 639afc20-984c-4a95-be35-8bf9409f02d5 --- # Compiler Error C3279 -partial and explicit specializations as well as explicit instantiations of class templates declared in the cli namespace are disallowed +> partial and explicit specializations as well as explicit instantiations of class templates declared in the cli namespace are disallowed + +## Remarks The `cli` namespace is defined by Microsoft and contains pseudo-templates. The Microsoft C++ compiler does not allow user-defined, partial and explicit specializations, and explicit instantiations of class templates in this namespace. -The following sample generates C3279: +## Example + +The following example generates C3279: ```cpp // C3279.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3280.md b/docs/error-messages/compiler-errors-2/compiler-error-c3280.md index c4d98cceae..f0e23ff566 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3280.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3280.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3280" title: "Compiler Error C3280" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3280" +ms.date: 11/04/2016 f1_keywords: ["C3280"] helpviewer_keywords: ["C3280"] -ms.assetid: 86dc5bbc-8818-4786-a728-9334268d308b --- # Compiler Error C3280 -'class' : a member-function of a managed type cannot be compiled as an unmanaged function +> 'class' : a member-function of a managed type cannot be compiled as an unmanaged function + +## Remarks Managed class member functions cannot be compiled as unmanaged functions. -The following sample generates C3280: +## Example + +The following example generates C3280: ```cpp // C3280_2.cpp