Skip to content

Structure error references in range [C3051, C3080] #5659

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-c3052.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3052"
title: "Compiler Error C3052"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3052"
ms.date: 11/04/2016
f1_keywords: ["C3052"]
helpviewer_keywords: ["C3052"]
ms.assetid: 87480c42-1ceb-4775-8d20-88c54a7bb6a6
---
# Compiler Error C3052

'var' : variable doesn't appear in a data-sharing clause under a default(none) clause
> 'var' : variable doesn't appear in a data-sharing clause under a default(none) clause

## Remarks

If [default(none)](../../parallel/openmp/reference/openmp-clauses.md#default-openmp) is used, any variable used in the structured block must be explicitly specified as either [shared](../../parallel/openmp/reference/openmp-clauses.md#shared-openmp) or [private](../../parallel/openmp/reference/openmp-clauses.md#private-openmp).

The following sample generates C3052:
## Example

The following example generates C3052:

```cpp
// C3052.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3053.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3053"
title: "Compiler Error C3053"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3053"
ms.date: 11/04/2016
f1_keywords: ["C3053"]
helpviewer_keywords: ["C3053"]
ms.assetid: ab9a25f3-e341-4f6e-8e69-069b4a963a64
---
# Compiler Error C3053

'symbol' : 'threadprivate' is only valid for global or static data items
> 'symbol' : 'threadprivate' is only valid for global or static data items

## Remarks

Symbols passed to [threadprivate](../../parallel/openmp/reference/openmp-directives.md#threadprivate) must either be global or static.

The following sample generates C3053:
## Example

The following example generates C3053:

```cpp
// C3053.cpp
Expand Down
5 changes: 2 additions & 3 deletions docs/error-messages/compiler-errors-2/compiler-error-c3054.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Error C3054"
title: "Compiler Error C3054"
description: "Learn more about: Compiler Error C3054"
ms.date: 06/01/2022
f1_keywords: ["C3054"]
helpviewer_keywords: ["C3054"]
ms.assetid: 6f4b7ac5-0d12-474b-b611-76ff26ee41ac
---
# Compiler Error C3054

Expand All @@ -18,7 +17,7 @@ This error is obsolete in Visual Studio 2022 and later versions.

## Example

The following sample generates C3054.
The following example generates C3054.

```cpp
// C3054.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3055.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3055"
title: "Compiler Error C3055"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3055"
ms.date: 11/04/2016
f1_keywords: ["C3055"]
helpviewer_keywords: ["C3055"]
ms.assetid: 60446ee0-18dd-48fc-9059-f0a14229dce8
---
# Compiler Error C3055

'symbol' : symbol cannot be referenced before it is used in 'threadprivate' directive
> 'symbol' : symbol cannot be referenced before it is used in 'threadprivate' directive

## Remarks

A symbol was referenced and then used in a [threadprivate](../../parallel/openmp/reference/openmp-directives.md#threadprivate) clause, which is not allowed.

The following sample generates C3055:
## Example

The following example generates C3055:

```cpp
// C3055.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3056.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3056"
title: "Compiler Error C3056"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3056"
ms.date: 11/04/2016
f1_keywords: ["C3056"]
helpviewer_keywords: ["C3056"]
ms.assetid: 9500173d-870b-49b3-8e88-0ee93586d19a
---
# Compiler Error C3056

'symbol' : symbol is not in the same scope with 'threadprivate' directive
> 'symbol' : symbol is not in the same scope with 'threadprivate' directive

## Remarks

A symbol used in a [threadprivate](../../parallel/openmp/reference/openmp-directives.md#threadprivate) clause must be in the same scope as the `threadprivate` clause.

The following sample generates C3056:
## Example

The following example generates C3056:

```cpp
// C3056.cpp
Expand Down
15 changes: 9 additions & 6 deletions docs/error-messages/compiler-errors-2/compiler-error-c3057.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3057"
title: "Compiler Error C3057"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3057"
ms.date: 11/04/2016
f1_keywords: ["C3057"]
helpviewer_keywords: ["C3057"]
ms.assetid: b0b2ba88-9c74-4bec-bf60-8fc72eade34c
---
# Compiler Error C3057

'symbol' : dynamic initialization of 'threadprivate' symbols is not currently supported
> 'symbol' : dynamic initialization of 'threadprivate' symbols is not currently supported

## Remarks

The initialized value of a symbol used in a [threadprivate](../../parallel/openmp/reference/openmp-directives.md#threadprivate) clause must be known at compile time.

The following sample generates C3057:
## Examples

The following example generates C3057:

```cpp
// C3057.cpp
Expand All @@ -38,7 +41,7 @@ int main() {
}
```

The following sample generates C3057:
The following example generates C3057:

```cpp
// C3057b.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3058.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3058"
title: "Compiler Error C3058"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3058"
ms.date: 11/04/2016
f1_keywords: ["C3058"]
helpviewer_keywords: ["C3058"]
ms.assetid: 669d08c8-0b58-4351-88aa-c6e6e1af481c
---
# Compiler Error C3058

'symbol' : symbol not declared as 'threadprivate' before it is used in the 'copyin' clause
> 'symbol' : symbol not declared as 'threadprivate' before it is used in the 'copyin' clause

## Remarks

A symbol must first be declared [threadprivate](../../parallel/openmp/reference/openmp-directives.md#threadprivate) before it can be used in a [copyin](../../parallel/openmp/reference/openmp-clauses.md#copyin) clause.

The following sample generates C3058:
## Example

The following example generates C3058:

```cpp
// C3058.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3059.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3059"
title: "Compiler Error C3059"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3059"
ms.date: 11/04/2016
f1_keywords: ["C3059"]
helpviewer_keywords: ["C3059"]
ms.assetid: 57220324-8286-4cab-a1ab-45385eb1eae0
---
# Compiler Error C3059

'var' : 'threadprivate' symbol cannot be used in the 'clause' clause
> 'var' : 'threadprivate' symbol cannot be used in the 'clause' clause

## Remarks

A [threadprivate](../../parallel/openmp/reference/openmp-directives.md#threadprivate) symbol was used in a clause.

The following sample generates C3059:
## Example

The following example generates C3059:

```cpp
// C3059.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3060.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3060"
title: "Compiler Error C3060"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3060"
ms.date: 11/04/2016
f1_keywords: ["C3060"]
helpviewer_keywords: ["C3060"]
ms.assetid: 6282bb92-0546-4b59-9435-d3840bf93bdb
---
# Compiler Error C3060

'member' : a friend function may not be defined inside a class using a qualified name (it may only be declared)
> 'member' : a friend function may not be defined inside a class using a qualified name (it may only be declared)

## Remarks

A friend function was defined using a qualified name, which is not allowed.

The following sample generates C3060:
## Example

The following example generates C3060:

```cpp
// C3060.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3062.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
---
description: "Learn more about: Compiler Error C3062"
title: "Compiler Error C3062"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3062"
ms.date: 11/04/2016
f1_keywords: ["C3062"]
helpviewer_keywords: ["C3062"]
ms.assetid: 78632e6d-255f-42c3-b124-31a9194ff86d
---
# Compiler Error C3062

'enum': enumerator requires value since the underlying type is 'type'
> 'enum': enumerator requires value since the underlying type is 'type'

## Remarks

You can specify an underlying type for an enumeration. However, some types require you to assign values to each enumerator.

For more information on enums, see [enum class](../../extensions/enum-class-cpp-component-extensions.md).

The following sample generates C3062:
## Example

The following example generates C3062:

```cpp
// C3062.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3063.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3063"
title: "Compiler Error C3063"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3063"
ms.date: 11/04/2016
f1_keywords: ["C3063"]
helpviewer_keywords: ["C3063"]
ms.assetid: 0ecf6f1f-e4a7-487a-9fd5-79d8ac470001
---
# Compiler Error C3063

operator 'operator': all operands must have the same enumeration type
> operator 'operator': all operands must have the same enumeration type

## Remarks

When using operators on enumerators, both operands must be of the enumeration type. For more information, see [How to: Define and consume enums in C++/CLI](../../dotnet/how-to-define-and-consume-enums-in-cpp-cli.md).

## Example

The following sample generates C3063 and shows how to fix it:
The following example generates C3063 and shows how to fix it:

```cpp
// C3063.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3065.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3065"
title: "Compiler Error C3065"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3065"
ms.date: 11/04/2016
f1_keywords: ["C3065"]
helpviewer_keywords: ["C3065"]
ms.assetid: e7a0bc69-1c68-459e-a7c4-93c65609ff7c
---
# Compiler Error C3065

property declaration at non-class scope is not allowed
> property declaration at non-class scope is not allowed

## Remarks

The [property](../../cpp/property-cpp.md) __declspec modifier was used outside a class. A property can only be declared inside a class.

The following sample generates C3065:
## Example

The following example generates C3065:

```cpp
// C3065.cpp
Expand Down
15 changes: 9 additions & 6 deletions docs/error-messages/compiler-errors-2/compiler-error-c3066.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3066"
title: "Compiler Error C3066"
ms.date: "03/28/2017"
description: "Learn more about: Compiler Error C3066"
ms.date: 03/28/2017
f1_keywords: ["C3066"]
helpviewer_keywords: ["C3066"]
ms.assetid: 226f6de5-c4c5-41e2-b31a-2e30a37fbbeb
---
# Compiler Error C3066

there are multiple ways that an object of this type can be called with these arguments
> there are multiple ways that an object of this type can be called with these arguments

## Remarks

The compiler detected an ambiguous function call involving surrogates.

The following sample generates C3066:
## Examples

The following example generates C3066:

```cpp
// C3066.cpp
Expand Down Expand Up @@ -46,7 +49,7 @@ int main() {
}
```

## Copy-list-initialization
### Copy-list-initialization

In Visual Studio 2015, the compiler erroneously treated copy-list-initialization in the same way as regular copy-initialization; it considered only converting constructors for overload resolution. In the following example, Visual Studio 2015 chooses MyInt(23) but Visual Studio 2017 correctly raises the error.

Expand Down
6 changes: 4 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c3068.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ helpviewer_keywords: ["C3068"]
---
# Compiler Error C3068

'function' : a 'naked' function cannot contain objects that would require unwinding if a C++ exception occurred
> 'function' : a 'naked' function cannot contain objects that would require unwinding if a C++ exception occurred

## Remarks

The compiler was unable to perform stack unwinding on a [naked](../../cpp/naked-cpp.md) function that threw an exception because a temporary object was created in the function and C++ exception handling ([/EHsc](../../build/reference/eh-exception-handling-model.md)) was specified.

Expand All @@ -25,7 +27,7 @@ When an exception is thrown, compiler generated code, called the prolog and epil

## Example

The following sample generates C3068:
The following example generates C3068:

```cpp
// C3068.cpp
Expand Down
Loading