diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2121.md b/docs/error-messages/compiler-errors-1/compiler-error-c2121.md index bcd354b2fc..3c2b477056 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2121.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2121.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2121" title: "Compiler Error C2121" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2121" +ms.date: 11/04/2016 f1_keywords: ["C2121"] helpviewer_keywords: ["C2121"] -ms.assetid: e04f32da-3736-4df3-8a1c-d687afcecf5c --- # Compiler Error C2121 -'#' : invalid character : possibly the result of a macro expansion +> '#' : invalid character : possibly the result of a macro expansion + +## Remarks An invalid # character may have been inserted by an incorrect macro that uses the token-pasting operator (##) instead of the stringizing operator (#). diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2122.md b/docs/error-messages/compiler-errors-1/compiler-error-c2122.md index a71d88a415..31ae2f699a 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2122.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2122.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2122" title: "Compiler Error C2122" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2122" +ms.date: 11/04/2016 f1_keywords: ["C2122"] helpviewer_keywords: ["C2122"] -ms.assetid: bc060002-cd38-481b-a144-65af035ce851 --- # Compiler Error C2122 -'identifier' : prototype parameter in name list illegal +> 'identifier' : prototype parameter in name list illegal + +## Remarks The parameter is not a legal type. ANSI C does not support user-defined types. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2124.md b/docs/error-messages/compiler-errors-1/compiler-error-c2124.md index 66e5e748be..e20cba89e6 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2124.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2124.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2124" title: "Compiler Error C2124" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2124" +ms.date: 11/04/2016 f1_keywords: ["C2124"] helpviewer_keywords: ["C2124"] -ms.assetid: 93392aaa-5582-4d68-8cc5-bd9c62a0ae7e --- # Compiler Error C2124 -divide or mod by zero +> divide or mod by zero + +## Remarks A constant expression has a zero denominator. To resolve the error, do not divide by zero. -The following sample generates C2124: +## Example + +The following example generates C2124: ```cpp // C2124.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2128.md b/docs/error-messages/compiler-errors-1/compiler-error-c2128.md index 242935dcf8..a2d21596f7 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2128.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2128.md @@ -1,17 +1,21 @@ --- -description: "Learn more about: Compiler Error C2128" title: "Compiler Error C2128" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2128" +ms.date: 11/04/2016 f1_keywords: ["C2128"] helpviewer_keywords: ["C2128"] --- # Compiler Error C2128 -'function' : alloc_text/same_seg applicable only to functions with C linkage +> 'function' : alloc_text/same_seg applicable only to functions with C linkage + +## Remarks `#pragma alloc_text` can only be used with functions declared to have C linkage. -The following sample generates C2128: +## Example + +The following example generates C2128: ```cpp // C2128.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2129.md b/docs/error-messages/compiler-errors-1/compiler-error-c2129.md index bc65e65142..161c15cfb9 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2129.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2129.md @@ -1,20 +1,23 @@ --- -description: "Learn more about: Compiler Error C2129" title: "Compiler Error C2129" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2129" +ms.date: 11/04/2016 f1_keywords: ["C2129"] helpviewer_keywords: ["C2129"] -ms.assetid: 21a8223e-1d22-4baa-9ca1-922b7f751dd0 --- # Compiler Error C2129 -static function 'function' declared but not defined +> static function 'function' declared but not defined + +## Remarks A forward reference is made to a **`static`** function that is never defined. A **`static`** function must be defined within file scope. If the function is defined in another file, it must be declared **`extern`**. -The following sample generates C2129: +## Example + +The following example generates C2129: ```cpp // C2129.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2130.md b/docs/error-messages/compiler-errors-1/compiler-error-c2130.md index cf56b31a74..5f1fd27161 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2130.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2130.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2130" title: "Compiler Error C2130" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2130" +ms.date: 11/04/2016 f1_keywords: ["C2130"] helpviewer_keywords: ["C2130"] -ms.assetid: c6fd5a7e-8f28-4f67-99d1-95a13b0dff90 --- # Compiler Error C2130 -\#line expected a string containing the filename, found 'token' +> #line expected a string containing the filename, found 'token' + +## Remarks The optional file name token following [#line](../../preprocessor/hash-line-directive-c-cpp.md) `linenumber` must be a string. -The following sample generates C2130: +## Example + +The following example generates C2130: ```cpp // C2130.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2131.md b/docs/error-messages/compiler-errors-1/compiler-error-c2131.md index 90733559e1..32855ce431 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2131.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2131.md @@ -1,7 +1,7 @@ --- -description: "Learn more about: Compiler Error C2131" title: "Compiler Error C2131" -ms.date: "02/28/2019" +description: "Learn more about: Compiler Error C2131" +ms.date: 02/28/2019 f1_keywords: ["C2131"] helpviewer_keywords: ["C2131"] --- @@ -9,6 +9,8 @@ helpviewer_keywords: ["C2131"] > expression did not evaluate to a constant +## Remarks + An expression declared as **`const`** or **`constexpr`** didn't evaluate to a constant at compile time. The compiler must be able to determine the value of the expression at the point it's used. ## Example diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2132.md b/docs/error-messages/compiler-errors-1/compiler-error-c2132.md index c4c2161533..0bf9a33074 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2132.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2132.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2132" title: "Compiler Error C2132" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2132" +ms.date: 11/04/2016 f1_keywords: ["C2132"] helpviewer_keywords: ["C2132"] -ms.assetid: 32902472-49d1-4513-888f-b52d336839d5 --- # Compiler Error C2132 -syntax error : unexpected identifier +> syntax error : unexpected identifier + +## Remarks An identifier appears in an unsupported context. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2133.md b/docs/error-messages/compiler-errors-1/compiler-error-c2133.md index bc9e05e319..fbeed35e5b 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2133.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2133.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2133" title: "Compiler Error C2133" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2133" +ms.date: 11/04/2016 f1_keywords: ["C2133"] helpviewer_keywords: ["C2133"] -ms.assetid: 8942f9e8-9818-468f-97db-09dbd124fcae --- # Compiler Error C2133 -'identifier' : unknown size +> 'identifier' : unknown size + +## Remarks An unsized array is declared as a member of a class, structure, union, or enumeration. The /Za (ANSI C) option does not allow unsized member arrays. -The following sample generates C2133: +## Example + +The following example generates C2133: ```cpp // C2133.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2134.md b/docs/error-messages/compiler-errors-1/compiler-error-c2134.md index 0436d94a76..2e79ffe2bb 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2134.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2134.md @@ -7,11 +7,15 @@ helpviewer_keywords: ["C2134"] --- # Compiler Error C2134 -'function' : call does not result in a constant expression +> 'function' : call does not result in a constant expression + +## Remarks A function declared as constexpr can only call other functions declared as constexpr. -The following sample generates C2134: +## Example + +The following example generates C2134: ```cpp // C2134.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2135.md b/docs/error-messages/compiler-errors-1/compiler-error-c2135.md index d830da92ac..4af1d4f1b4 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2135.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2135.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2135" title: "Compiler Error C2135" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2135" +ms.date: 11/04/2016 f1_keywords: ["C2135"] helpviewer_keywords: ["C2135"] -ms.assetid: aa360d22-4f79-4de1-b384-93cadd10975f --- # Compiler Error C2135 -'bit operator' : illegal bit field operation +> 'bit operator' : illegal bit field operation + +## Remarks The address-of operator (`&`) cannot be applied to a bit field. -The following sample generates C2135: +## Example + +The following example generates C2135: ```cpp // C2135.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2137.md b/docs/error-messages/compiler-errors-1/compiler-error-c2137.md index bb5b13eaa6..283c3c3777 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2137.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2137.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2137" title: "Compiler Error C2137" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2137" +ms.date: 11/04/2016 f1_keywords: ["C2137"] helpviewer_keywords: ["C2137"] -ms.assetid: 984687ee-7766-4f6b-ae15-0c9a010e2366 --- # Compiler Error C2137 -empty character constant +> empty character constant + +## Remarks The empty character constant ( ' ' ) is not permitted. -The following sample generates C2137: +## Example + +The following example generates C2137: ```cpp // C2137.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2138.md b/docs/error-messages/compiler-errors-1/compiler-error-c2138.md index 77a93bb632..3b597d22ad 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2138.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2138.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2138" title: "Compiler Error C2138" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2138" +ms.date: 11/04/2016 f1_keywords: ["C2138"] helpviewer_keywords: ["C2138"] -ms.assetid: 59fd1a58-3605-45dd-b9c1-0981e8aab26d --- # Compiler Error C2138 -illegal to define an enumeration without any members +> illegal to define an enumeration without any members + +## Remarks An enumeration must have at least one member when /Za (disable Microsoft extensions) is selected. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2139.md b/docs/error-messages/compiler-errors-1/compiler-error-c2139.md index e14f1709bf..3f09eaac25 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2139.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2139.md @@ -1,6 +1,6 @@ --- -description: "Learn more about: Compiler Error C2139" title: "Compiler Error C2139" +description: "Learn more about: Compiler Error C2139" ms.date: 05/03/2021 f1_keywords: ["C2139"] helpviewer_keywords: ["C2139"] @@ -9,15 +9,15 @@ helpviewer_keywords: ["C2139"] > '*type*' : an undefined class is not allowed as an argument to compiler intrinsic type trait '*trait*' -An invalid argument was passed to a type trait. - ## Remarks +An invalid argument was passed to a type trait. + For more information, see [Compiler Support for Type Traits](../../extensions/compiler-support-for-type-traits-cpp-component-extensions.md). ## Example -The following sample generates C2139. +The following example generates C2139. ```cpp // C2139.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2140.md b/docs/error-messages/compiler-errors-1/compiler-error-c2140.md index 59c8c1212f..5d5a064807 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2140.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2140.md @@ -1,14 +1,15 @@ --- -description: "Learn more about: Compiler Error C2140" title: "Compiler Error C2140" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2140" +ms.date: 11/04/2016 f1_keywords: ["C2140"] helpviewer_keywords: ["C2140"] -ms.assetid: d44a0500-002c-4632-9e5e-c71c3a473ec4 --- # Compiler Error C2140 -'type' : a type that is dependent on a generic type parameter is not allowed as an argument to compiler intrinsic type trait 'trait' +> 'type' : a type that is dependent on a generic type parameter is not allowed as an argument to compiler intrinsic type trait 'trait' + +## Remarks An invalid type specifier was passed to a type trait. @@ -16,7 +17,7 @@ For more information, see [Compiler Support for Type Traits](../../extensions/co ## Example -The following sample generates C2140. +The following example generates C2140. ```cpp // C2140.cpp