diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2201.md b/docs/error-messages/compiler-errors-1/compiler-error-c2201.md index aa9d535631..01983a4cf4 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2201.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2201.md @@ -1,6 +1,6 @@ --- -description: "Learn more about: Compiler Error C2201" title: "Compiler Error C2201" +description: "Learn more about: Compiler Error C2201" ms.date: 05/03/2021 f1_keywords: ["C2201"] helpviewer_keywords: ["C2201"] @@ -9,11 +9,13 @@ helpviewer_keywords: ["C2201"] > '*identifier*' : must have external linkage in order to be exported/imported +## Remarks + The exported identifier is **`static`**. ## Example -The following sample generates C2286, and shows how to fix it: +The following example generates C2286, and shows how to fix it: ```cpp // C2201.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2203.md b/docs/error-messages/compiler-errors-1/compiler-error-c2203.md index 6171c53c18..1850f52d27 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2203.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2203.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2203" title: "Compiler Error C2203" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2203" +ms.date: 11/04/2016 f1_keywords: ["C2203"] helpviewer_keywords: ["C2203"] -ms.assetid: 5497df43-86f6-43d5-b6cb-723c4c589b10 --- # Compiler Error C2203 -delete operator cannot specify bounds for an array +> delete operator cannot specify bounds for an array + +## Remarks With the **/Za** (ANSI) option, the **`delete`** operator can delete an entire array but not parts or specific members of the array. -The following sample generates C2203: +## Example + +The following example generates C2203: ```cpp // C2203.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2204.md b/docs/error-messages/compiler-errors-1/compiler-error-c2204.md index 001aefd823..b09f6a116a 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2204.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2204.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2204" title: "Compiler Error C2204" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2204" +ms.date: 11/04/2016 f1_keywords: ["C2204"] helpviewer_keywords: ["C2204"] -ms.assetid: bbe506d4-7863-44af-8709-161881c4b4ba --- # Compiler Error C2204 -'type' : type definition found within parentheses +> 'type' : type definition found within parentheses + +## Remarks The type is defined as an operand or in prototype scope. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2205.md b/docs/error-messages/compiler-errors-1/compiler-error-c2205.md index 933e582806..6b073e8cc7 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2205.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2205.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2205" title: "Compiler Error C2205" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2205" +ms.date: 11/04/2016 f1_keywords: ["C2205"] helpviewer_keywords: ["C2205"] -ms.assetid: bfc19840-4a48-4da5-8e69-7069989f1d2c --- # Compiler Error C2205 -'identifier' : cannot initialize extern variables with block scope +> 'identifier' : cannot initialize extern variables with block scope + +## Remarks An **`extern`** variable cannot be initialized in a function. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2206.md b/docs/error-messages/compiler-errors-1/compiler-error-c2206.md index ecc111e042..611865407d 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2206.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2206.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2206" title: "Compiler Error C2206" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2206" +ms.date: 11/04/2016 f1_keywords: ["C2206"] helpviewer_keywords: ["C2206"] -ms.assetid: d7fba68b-aa28-4885-a9a0-27107358f066 --- # Compiler Error C2206 -'function' : typedef cannot be used for function definition +> 'function' : typedef cannot be used for function definition + +## Remarks A **`typedef`** is used to define a function type. -The following sample generates C2206: +## Example + +The following example generates C2206: ```cpp // C2206.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2207.md b/docs/error-messages/compiler-errors-1/compiler-error-c2207.md index 1f1fffd0dd..fab75ec1e1 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2207.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2207.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2207" title: "Compiler Error C2207" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2207" +ms.date: 11/04/2016 f1_keywords: ["C2207"] helpviewer_keywords: ["C2207"] -ms.assetid: d7d7b537-68f1-420a-9835-b5b6f2cb5cfd --- # Compiler Error C2207 -'member': a member of a class template cannot acquire a function type +> 'member': a member of a class template cannot acquire a function type + +## Remarks The `member` of the class template was previously parsed as a non-static data member. It cannot be redefined as a member function. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2208.md b/docs/error-messages/compiler-errors-1/compiler-error-c2208.md index b191a05734..6c3ca30878 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2208.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2208.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2208" title: "Compiler Error C2208" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2208" +ms.date: 11/04/2016 f1_keywords: ["C2208"] helpviewer_keywords: ["C2208"] -ms.assetid: 9ae704bc-bf70-45f1-8e47-0470f21edd4e --- # Compiler Error C2208 -'type' : no members defined using this type +> 'type' : no members defined using this type + +## Remarks An identifier resolving to a type name is in an aggregate declaration, but the compiler cannot declare a member. -The following sample generates C2208: +## Example + +The following example generates C2208: ```cpp // C2208.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2212.md b/docs/error-messages/compiler-errors-1/compiler-error-c2212.md index db3551919f..16a9f9f198 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2212.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2212.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2212" title: "Compiler Error C2212" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2212" +ms.date: 11/04/2016 f1_keywords: ["C2212"] helpviewer_keywords: ["C2212"] -ms.assetid: 3fdab304-272c-4d07-bfd4-fad75170e536 --- # Compiler Error C2212 -'identifier' : __based not available for pointers to functions +> 'identifier' : __based not available for pointers to functions + +## Remarks Pointers to functions cannot be declared **`__based`**. If you need code-based data, use the **`__declspec`** keyword or the `data_seg` pragma. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2213.md b/docs/error-messages/compiler-errors-1/compiler-error-c2213.md index ef1d970869..667f53b64d 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2213.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2213.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2213" title: "Compiler Error C2213" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2213" +ms.date: 11/04/2016 f1_keywords: ["C2213"] helpviewer_keywords: ["C2213"] -ms.assetid: ff012278-7f3b-4d49-aaed-2349756f6225 --- # Compiler Error C2213 -'modifier' : illegal argument to __based +> 'modifier' : illegal argument to __based + +## Remarks The argument modifying **`__based`** is invalid. -The following sample generates C2213: +## Example + +The following example generates C2213: ```cpp // C2213.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2216.md b/docs/error-messages/compiler-errors-1/compiler-error-c2216.md index 51d2a53818..5d0d49c0e9 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2216.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2216.md @@ -1,20 +1,21 @@ --- -description: "Learn more about: Compiler Error C2216" title: "Compiler Error C2216" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2216" +ms.date: 11/04/2016 f1_keywords: ["C2216"] helpviewer_keywords: ["C2216"] -ms.assetid: 250f6bdc-a5e1-495f-a1e8-6e8e7021ad9d --- # Compiler Error C2216 -'keyword1' cannot be used with ' keyword2' +> 'keyword1' cannot be used with ' keyword2' + +## Remarks Two keywords that are mutually exclusive were used together. ## Examples -The following sample generates C2216. +The following example generates C2216. ```cpp // C2216.cpp @@ -25,7 +26,7 @@ ref struct Y1 { }; ``` -The following sample generates C2216. +The following example generates C2216. ```cpp // C2216b.cpp @@ -36,7 +37,7 @@ public ref class X { }; ``` -The following sample generates C2216. +The following example generates C2216. ```cpp // C2216c.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2217.md b/docs/error-messages/compiler-errors-1/compiler-error-c2217.md index 009e512bf1..b13e45b5ee 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2217.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2217.md @@ -1,20 +1,21 @@ --- -description: "Learn more about: Compiler Error C2217" title: "Compiler Error C2217" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2217" +ms.date: 11/04/2016 f1_keywords: ["C2217"] helpviewer_keywords: ["C2217"] -ms.assetid: 1ce1e3f5-4171-4376-804d-967f7e612935 --- # Compiler Error C2217 -'attribute1' requires 'attribute2' +> 'attribute1' requires 'attribute2' + +## Remarks The first function attribute requires the second attribute. ## Example -C2217 can occur if you attempt to bind a delegate to a CLR function that takes a variable number of arguments. If the function also has a param array overload, use that instead. The following sample generates C2217. +C2217 can occur if you attempt to bind a delegate to a CLR function that takes a variable number of arguments. If the function also has a param array overload, use that instead. The following example generates C2217. ```cpp // C2217.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2218.md b/docs/error-messages/compiler-errors-1/compiler-error-c2218.md index a5f9621240..07e17522d3 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2218.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2218.md @@ -1,15 +1,16 @@ --- -description: "Learn more about: Compiler Error C2218" title: "Compiler Error C2218" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2218" +ms.date: 11/04/2016 f1_keywords: ["C2218"] helpviewer_keywords: ["C2218"] -ms.assetid: b0f55da4-8edb-4b45-b298-1a091981bd7b --- # Compiler Error C2218 > '__vectorcall' cannot be used with '/arch:IA32' +## Remarks + The **`__vectorcall`** calling convention is only supported in native code on x86 and x64 processors that include Streaming SIMD Extensions 2 (SSE2) and above. For more information, see [`__vectorcall`](../../cpp/vectorcall.md). To fix this error, change the compiler options to target SSE2, AVX or AVX2 instruction sets. For more information, see [`/arch` (x86)](../../build/reference/arch-x86.md). diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2219.md b/docs/error-messages/compiler-errors-1/compiler-error-c2219.md index eb2fc27f7d..499519f546 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2219.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2219.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2219" title: "Compiler Error C2219" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2219" +ms.date: 11/04/2016 f1_keywords: ["C2219"] helpviewer_keywords: ["C2219"] -ms.assetid: 2cfe9a75-6890-46a1-a127-79a7def78e94 --- # Compiler Error C2219 -syntax error : type qualifier must be after '*' +> syntax error : type qualifier must be after '*' + +## Remarks Type qualifier (**`const`** or **`volatile`**) appears where it is not permitted. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2220.md b/docs/error-messages/compiler-errors-1/compiler-error-c2220.md index edfa71f27b..0660cff0df 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2220.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2220.md @@ -1,14 +1,15 @@ --- -description: "Learn more about: Compiler Error C2220" title: "Compiler Error C2220" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2220" +ms.date: 11/04/2016 f1_keywords: ["C2220"] helpviewer_keywords: ["C2220"] -ms.assetid: d610802c-64d7-40ad-a2a6-0ed0b6815a6c --- # Compiler Error C2220 -warning treated as error - no object file generated +> warning treated as error - no object file generated + +## Remarks [/WX](../../build/reference/compiler-option-warning-level.md) tells the compiler to treat all warnings as errors. Because an error occurred, no object or executable file was generated. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2222.md b/docs/error-messages/compiler-errors-1/compiler-error-c2222.md index 7d2bc23ae5..894171131f 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2222.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2222.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2222" title: "Compiler Error C2222" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2222" +ms.date: 11/04/2016 f1_keywords: ["C2222"] helpviewer_keywords: ["C2222"] -ms.assetid: 1c902054-5c77-41e6-a1cc-018f802460cd --- # Compiler Error C2222 -unexpected type 'type': a base-class or member was expected +> unexpected type 'type': a base-class or member was expected + +## Remarks The initializer list can only initialize base classes or members of a type. To fix this error, verify that only base classes or members of the type are initialized in the initializer list. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2223.md b/docs/error-messages/compiler-errors-1/compiler-error-c2223.md index cc9b730639..4607f1838a 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2223.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2223.md @@ -1,14 +1,15 @@ --- -description: "Learn more about: Compiler Error C2223" title: "Compiler Error C2223" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2223" +ms.date: 11/04/2016 f1_keywords: ["C2223"] helpviewer_keywords: ["C2223"] -ms.assetid: e4506f0f-0317-4a96-8a90-877a156d7939 --- # Compiler Error C2223 -left of '->identifier' must point to struct/union +> left of '->identifier' must point to struct/union + +## Remarks The operand to the left of `->` is not a pointer to a class, structure, or union. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2224.md b/docs/error-messages/compiler-errors-1/compiler-error-c2224.md index 7bd87633ef..7d13d46a0e 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2224.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2224.md @@ -1,14 +1,15 @@ --- -description: "Learn more about: Compiler Error C2224" title: "Compiler Error C2224" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2224" +ms.date: 11/04/2016 f1_keywords: ["C2224"] helpviewer_keywords: ["C2224"] -ms.assetid: 27b93bbf-4ce7-47a3-a9c4-f4fbed689bdf --- # Compiler Error C2224 -left of '.identifier' must have struct/union type +> left of '.identifier' must have struct/union type + +## Remarks The operand to the left of the period (.) is not a class, structure, or union. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2226.md b/docs/error-messages/compiler-errors-1/compiler-error-c2226.md index 5ad3e47775..7576eab5fe 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2226.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2226.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2226" title: "Compiler Error C2226" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2226" +ms.date: 11/04/2016 f1_keywords: ["C2226"] helpviewer_keywords: ["C2226"] -ms.assetid: b3aaa2a5-254a-46a9-a508-de2371ecffeb --- # Compiler Error C2226 -syntax error : unexpected type 'type' +> syntax error : unexpected type 'type' + +## Remarks A syntax error occurs before or in the type specifier. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2227.md b/docs/error-messages/compiler-errors-1/compiler-error-c2227.md index 15613f96e1..4c84efc13a 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2227.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2227.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2227" title: "Compiler Error C2227" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2227" +ms.date: 11/04/2016 f1_keywords: ["C2227"] helpviewer_keywords: ["C2227"] -ms.assetid: d470e8b8-7e15-468b-84fa-37d1a0132271 --- # Compiler Error C2227 -left of '->member' must point to class/struct/union/generic type +> left of '->member' must point to class/struct/union/generic type + +## Remarks The operand to the left of `->` is not a pointer to a class, structure, or union. -The following sample generates C2227: +## Example + +The following example generates C2227: ```cpp // C2227.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2228.md b/docs/error-messages/compiler-errors-1/compiler-error-c2228.md index d8cc1b4db9..f0605e69fc 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2228.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2228.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2228" title: "Compiler Error C2228" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2228" +ms.date: 11/04/2016 f1_keywords: ["C2228"] helpviewer_keywords: ["C2228"] -ms.assetid: 901cadb1-ce90-4ae0-a360-547a9ba2ca18 --- # Compiler Error C2228 -left of '.identifier' must have class/struct/union +> left of '.identifier' must have class/struct/union + +## Remarks The operand to the left of the period (.) is not a class, structure, or union. -The following sample generates C2228: +## Example + +The following example generates C2228: ```cpp // C2228.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2229.md b/docs/error-messages/compiler-errors-1/compiler-error-c2229.md index 24ce025b2c..a77432e3f1 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2229.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2229.md @@ -1,14 +1,15 @@ --- -description: "Learn more about: Compiler Error C2229" title: "Compiler Error C2229" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2229" +ms.date: 11/04/2016 f1_keywords: ["C2229"] helpviewer_keywords: ["C2229"] -ms.assetid: 933c7cf2-a463-4e74-b0b4-59dedad987fb --- # Compiler Error C2229 -type 'identifier' has an illegal zero-sized array +> type 'identifier' has an illegal zero-sized array + +## Remarks A member of a structure or bit field contains a zero-sized array that is not the last member. @@ -16,7 +17,9 @@ Because you can have a zero sized array as the last member of the struct, you mu If the zero sized array is not the last member of the struct, the compiler can't calculate the offset for the remaining fields. -The following sample generates C2229: +## Example + +The following example generates C2229: ```cpp // C2229.cpp