diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3031.md b/docs/error-messages/compiler-errors-2/compiler-error-c3031.md index ad1689a82f..583e25e206 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3031.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3031.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3031" title: "Compiler Error C3031" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3031" +ms.date: 11/04/2016 f1_keywords: ["C3031"] helpviewer_keywords: ["C3031"] -ms.assetid: 7e621e7e-eda7-45b5-8836-29599cd05255 --- # Compiler Error C3031 -'var' : variable in 'reduction' clause must have scalar arithmetic type +> 'var' : variable in 'reduction' clause must have scalar arithmetic type + +## Remarks A variable of the wrong type was passed to a reduction clause. -The following sample generates C3031: +## Example + +The following example generates C3031: ```cpp // C3031.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3032.md b/docs/error-messages/compiler-errors-2/compiler-error-c3032.md index 0feba15df8..02ada4cb73 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3032.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3032.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3032" title: "Compiler Error C3032" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3032" +ms.date: 11/04/2016 f1_keywords: ["C3032"] helpviewer_keywords: ["C3032"] -ms.assetid: 6a92bd8e-319f-4a99-aef4-a9021f6f9928 --- # Compiler Error C3032 -'var' : variable in 'clause' clause cannot have incomplete type 'type' +> 'var' : variable in 'clause' clause cannot have incomplete type 'type' + +## Remarks Types passed to certain clauses must be fully visible to the compiler. -The following sample generates C3032: +## Example + +The following example generates C3032: ```cpp // C3032.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3033.md b/docs/error-messages/compiler-errors-2/compiler-error-c3033.md index b1dcebc9f7..420ba6376b 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3033.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3033.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3033" title: "Compiler Error C3033" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3033" +ms.date: 11/04/2016 f1_keywords: ["C3033"] helpviewer_keywords: ["C3033"] -ms.assetid: 8628b6bb-a650-4ed2-af13-57acd2f7ddbb --- # Compiler Error C3033 -'var' : variable in 'clause' clause cannot have const-qualified type +> 'var' : variable in 'clause' clause cannot have const-qualified type + +## Remarks Values passed to certain clauses cannot be **`const`** variables. -The following sample generates C3033: +## Example + +The following example generates C3033: ```cpp // C3033.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3034.md b/docs/error-messages/compiler-errors-2/compiler-error-c3034.md index c6581ba1b3..9d76496fe4 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3034.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3034.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3034" title: "Compiler Error C3034" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3034" +ms.date: 11/04/2016 f1_keywords: ["C3034"] helpviewer_keywords: ["C3034"] -ms.assetid: 49db8bac-2720-4622-94e3-7988f1603fa3 --- # Compiler Error C3034 -OpenMP 'directive1' directive cannot be directly nested within 'directive2' directive +> OpenMP 'directive1' directive cannot be directly nested within 'directive2' directive + +## Remarks Some directives cannot be nested. To fix this error, you can merge the statements of both directives into the block of one directive, or you can construct consecutive directives. -The following sample generates C3034: +## Example + +The following example generates C3034: ```cpp // C3034.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3035.md b/docs/error-messages/compiler-errors-2/compiler-error-c3035.md index 3fcf1e25f1..fd2006a31d 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3035.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3035.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3035" title: "Compiler Error C3035" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3035" +ms.date: 11/04/2016 f1_keywords: ["C3035"] helpviewer_keywords: ["C3035"] -ms.assetid: af34fad2-2b45-42d0-a9ff-04eab3e91c37 --- # Compiler Error C3035 -OpenMP 'ordered' directive must bind directly to a 'for' or 'parallel for' directive with the 'ordered' clause +> OpenMP 'ordered' directive must bind directly to a 'for' or 'parallel for' directive with the 'ordered' clause + +## Remarks An ordered clause was ill formed. -The following sample generates C3035: +## Example + +The following example generates C3035: ```cpp // C3035.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3036.md b/docs/error-messages/compiler-errors-2/compiler-error-c3036.md index 597adf0ff4..0584a878e5 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3036.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3036.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3036" title: "Compiler Error C3036" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3036" +ms.date: 11/04/2016 f1_keywords: ["C3036"] helpviewer_keywords: ["C3036"] -ms.assetid: 10c6993e-bc42-4a07-85c7-cdc34ac30906 --- # Compiler Error C3036 -'operator' : invalid operator token in OpenMP 'reduction' clause +> 'operator' : invalid operator token in OpenMP 'reduction' clause + +## Remarks A [reduction](../../parallel/openmp/reference/openmp-clauses.md#reduction) clause was not specified correctly. -The following sample generates C3036: +## Example + +The following example generates C3036: ```cpp // C3036.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3037.md b/docs/error-messages/compiler-errors-2/compiler-error-c3037.md index 13cb9a96f5..fce1f7b964 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3037.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3037.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3037" title: "Compiler Error C3037" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3037" +ms.date: 11/04/2016 f1_keywords: ["C3037"] helpviewer_keywords: ["C3037"] -ms.assetid: 9ba8a890-d3c7-4cce-93c5-d358e2bfad28 --- # Compiler Error C3037 -'var' : variable in 'reduction' clause must be shared in enclosing context +> 'var' : variable in 'reduction' clause must be shared in enclosing context + +## Remarks A variable specified in a [reduction](../../parallel/openmp/reference/openmp-clauses.md#reduction) clause may not be private to each thread in the context. -The following sample generates C3037: +## Example + +The following example generates C3037: ```cpp // C3037.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3038.md b/docs/error-messages/compiler-errors-2/compiler-error-c3038.md index 1219fcdd1e..9819029d53 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3038.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3038.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3038" title: "Compiler Error C3038" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3038" +ms.date: 11/04/2016 f1_keywords: ["C3038"] helpviewer_keywords: ["C3038"] -ms.assetid: 140ada3e-5636-43ef-a4ee-22a9f66a771f --- # Compiler Error C3038 -'var' : variable in 'private' clause cannot be a reduction variable in enclosing context +> 'var' : variable in 'private' clause cannot be a reduction variable in enclosing context + +## Remarks Variables that appear in the [reduction](../../parallel/openmp/reference/openmp-clauses.md#reduction) clause of a parallel directive cannot be specified in a [private](../../parallel/openmp/reference/openmp-clauses.md#private-openmp) clause on a work-sharing directive that binds to the parallel construct. -The following sample generates C3038: +## Example + +The following example generates C3038: ```cpp // C3038.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3039.md b/docs/error-messages/compiler-errors-2/compiler-error-c3039.md index c502959275..92bc1abf4b 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3039.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3039.md @@ -1,20 +1,21 @@ --- -description: "Learn more about: Compiler Error C3039" title: "Compiler Error C3039" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3039" +ms.date: 11/04/2016 f1_keywords: ["C3039"] helpviewer_keywords: ["C3039"] -ms.assetid: 02776f16-f57a-4ffd-b7f7-9c696b633e08 --- # Compiler Error C3039 -'var' : index variable in OpenMP 'for' statement cannot be a reduction variable +> 'var' : index variable in OpenMP 'for' statement cannot be a reduction variable + +## Remarks An index variable is implicitly private, so the variable cannot be used in a [reduction](../../parallel/openmp/reference/openmp-clauses.md#reduction) clause in the enclosing [parallel](../../parallel/openmp/reference/openmp-directives.md#parallel) directive. ## Example -The following sample generates C3039: +The following example generates C3039: ```cpp // C3039.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3040.md b/docs/error-messages/compiler-errors-2/compiler-error-c3040.md index 33c117e5f4..82f04a80bc 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3040.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3040.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3040" title: "Compiler Error C3040" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3040" +ms.date: 11/04/2016 f1_keywords: ["C3040"] helpviewer_keywords: ["C3040"] -ms.assetid: 29e857ac-74f0-4ec6-becf-9026e38c160e --- # Compiler Error C3040 -'var' : type of variable in 'reduction' clause is incompatible with reduction operator 'operator' +> 'var' : type of variable in 'reduction' clause is incompatible with reduction operator 'operator' + +## Remarks A variable in a [reduction](../../parallel/openmp/reference/openmp-clauses.md#reduction) clause cannot be used with the reduction operator. -The following sample generates C3040: +## Example + +The following example generates C3040: ```cpp // C3040.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3041.md b/docs/error-messages/compiler-errors-2/compiler-error-c3041.md index fb2a1a285d..5c60eb3ff1 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3041.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3041.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3041" title: "Compiler Error C3041" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3041" +ms.date: 11/04/2016 f1_keywords: ["C3041"] helpviewer_keywords: ["C3041"] -ms.assetid: 9df1ae44-3ac7-4c6c-899f-f35ffe7ccf0d --- # Compiler Error C3041 -'var' : variable in 'copyprivate' clause must be private in enclosing context +> 'var' : variable in 'copyprivate' clause must be private in enclosing context + +## Remarks A variable passed to [copyprivate](../../parallel/openmp/reference/openmp-clauses.md#copyprivate) cannot be shared in the enclosing context. -The following sample generates C3041: +## Example + +The following example generates C3041: ```cpp // C3041.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3042.md b/docs/error-messages/compiler-errors-2/compiler-error-c3042.md index ba13716ff0..8b52b9ae98 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3042.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3042.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3042" title: "Compiler Error C3042" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3042" +ms.date: 11/04/2016 f1_keywords: ["C3042"] helpviewer_keywords: ["C3042"] -ms.assetid: bf73f61e-5bd2-40a8-9b06-6244e6a15a41 --- # Compiler Error C3042 -'copyprivate' and 'nowait' clauses cannot appear together on OpenMP 'directive' directive +> 'copyprivate' and 'nowait' clauses cannot appear together on OpenMP 'directive' directive + +## Remarks The [copyprivate](../../parallel/openmp/reference/openmp-clauses.md#copyprivate) and [nowait](../../parallel/openmp/reference/openmp-clauses.md#nowait) clauses are mutually exclusive on the specified directive. To fix this error, remove one or both of the `copyprivate` or `nowait` clauses. -The following sample generates C3042: +## Example + +The following example generates C3042: ```cpp // C3042.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3043.md b/docs/error-messages/compiler-errors-2/compiler-error-c3043.md index 2e2a807aa5..ceb6883d66 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3043.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3043.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3043" title: "Compiler Error C3043" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3043" +ms.date: 11/04/2016 f1_keywords: ["C3043"] helpviewer_keywords: ["C3043"] -ms.assetid: 0ef55e63-e82b-48eb-9d44-690950ac34c6 --- # Compiler Error C3043 -OpenMP 'critical' directive cannot be nested in 'critical' directive with same name +> OpenMP 'critical' directive cannot be nested in 'critical' directive with same name + +## Remarks A [critical](../../parallel/openmp/reference/openmp-directives.md#critical) directive cannot be nested in a `critical` directive that uses the same name. -The following sample generates C3043: +## Example + +The following example generates C3043: ```cpp // C3043.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3044.md b/docs/error-messages/compiler-errors-2/compiler-error-c3044.md index 26b146188d..ae3ed18c23 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3044.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3044.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3044" title: "Compiler Error C3044" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3044" +ms.date: 11/04/2016 f1_keywords: ["C3044"] helpviewer_keywords: ["C3044"] -ms.assetid: 9f3e25b2-4676-49ab-97bf-6c88cd0fa377 --- # Compiler Error C3044 -'section' : only allowed directly nested under an OpenMP 'sections' directive +> 'section' : only allowed directly nested under an OpenMP 'sections' directive + +## Remarks The compiler found a `section` directive was used incorrectly. For more information, see [sections](../../parallel/openmp/reference/openmp-directives.md#sections-openmp). -The following sample generates C3044: +## Example + +The following example generates C3044: ```cpp // C3044.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3045.md b/docs/error-messages/compiler-errors-2/compiler-error-c3045.md index 67891c401e..6c59aff18d 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3045.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3045.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3045" title: "Compiler Error C3045" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3045" +ms.date: 11/04/2016 f1_keywords: ["C3045"] helpviewer_keywords: ["C3045"] -ms.assetid: 9351ba3e-3d3f-455f-ac90-a810fa9fd947 --- # Compiler Error C3045 -Expected a compound statement following OpenMP 'sections' directive. Missing '{' +> Expected a compound statement following OpenMP 'sections' directive. Missing '{' + +## Remarks A code block delimited by braces must follow a [sections](../../parallel/openmp/reference/openmp-directives.md#sections-openmp) directive. -The following sample generates C3045: +## Example + +The following example generates C3045: ```cpp // C3045.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3046.md b/docs/error-messages/compiler-errors-2/compiler-error-c3046.md index da74cf83c7..3633da04ab 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3046.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3046.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3046" title: "Compiler Error C3046" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3046" +ms.date: 11/04/2016 f1_keywords: ["C3046"] helpviewer_keywords: ["C3046"] -ms.assetid: 2e53d835-faa1-4ec0-9807-41f3dc552635 --- # Compiler Error C3046 -Missing structured block in an OpenMP '#pragma omp sections' region +> Missing structured block in an OpenMP '#pragma omp sections' region + +## Remarks A [sections](../../parallel/openmp/reference/openmp-directives.md#sections-openmp) directive has an empty code block. -The following sample generates C3046: +## Example + +The following example generates C3046: ```cpp // C3046.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3047.md b/docs/error-messages/compiler-errors-2/compiler-error-c3047.md index 33412373c1..850e45397b 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3047.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3047.md @@ -1,20 +1,23 @@ --- -description: "Learn more about: Compiler Error C3047" title: "Compiler Error C3047" +description: "Learn more about: Compiler Error C3047" ms.date: 06/01/2022 f1_keywords: ["C3047"] helpviewer_keywords: ["C3047"] -ms.assetid: 91c14566-5958-433d-8549-0e8bc3196f76 --- # Compiler Error C3047 > Structured block in an OpenMP 'sections' region must be preceded by '#pragma omp section' +## Remarks + Any code in a code block introduced by a [sections](../../parallel/openmp/reference/openmp-directives.md#sections-openmp) directive must be in a code block introduced by a `section` directive. This error is obsolete in Visual Studio 2022 and later versions. -The following sample generates C3047: +## Example + +The following example generates C3047: ```cpp // C3047.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3048.md b/docs/error-messages/compiler-errors-2/compiler-error-c3048.md index 62ceeb6d4e..20c553cc78 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3048.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3048.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3048" title: "Compiler Error C3048" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3048" +ms.date: 11/04/2016 f1_keywords: ["C3048"] helpviewer_keywords: ["C3048"] -ms.assetid: 48e07091-94d9-471d-befe-7e2507631edd --- # Compiler Error C3048 -Expression following '#pragma omp atomic' has improper form +> Expression following '#pragma omp atomic' has improper form + +## Remarks An atomic directive was incorrectly specified. -The following sample generates C3048: +## Example + +The following example generates C3048: ```cpp // C3048.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3049.md b/docs/error-messages/compiler-errors-2/compiler-error-c3049.md index 3b87b0f374..b89c25bb6d 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3049.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3049.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3049" title: "Compiler Error C3049" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3049" +ms.date: 11/04/2016 f1_keywords: ["C3049"] helpviewer_keywords: ["C3049"] -ms.assetid: 6ddf54f6-2c30-4d04-b637-98c6c922c533 --- # Compiler Error C3049 -'arg' : invalid argument in OpenMP 'default' clause +> 'arg' : invalid argument in OpenMP 'default' clause + +## Remarks An incorrect value was passed to a [default](../../parallel/openmp/reference/openmp-clauses.md#default-openmp) clause. -The following sample generates C3049: +## Example + +The following example generates C3049: ```cpp // C3049.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3050.md b/docs/error-messages/compiler-errors-2/compiler-error-c3050.md index 95167d41bc..853b205551 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3050.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3050.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3050" title: "Compiler Error C3050" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3050" +ms.date: 11/04/2016 f1_keywords: ["C3050"] helpviewer_keywords: ["C3050"] -ms.assetid: ee090a0b-29cc-4215-a2f9-d82af79b8e82 --- # Compiler Error C3050 -'type1' : a ref class cannot inherit from 'type1' +> 'type1' : a ref class cannot inherit from 'type1' + +## Remarks `System::ValueType` cannot be a base class for a reference type. -The following sample generates C3050: +## Example + +The following example generates C3050: ```cpp // C3050.cpp