Skip to content

Structure error references in range [C3031, C3050] #5655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3031.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3032.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3033.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3034.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3035.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3036.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3037.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3038.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3039.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3040.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3041.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3042.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3043.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3044.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading