Skip to content
Merged
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
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3282.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3282"
title: "Compiler Error C3282"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3282"
ms.date: 11/04/2016
f1_keywords: ["C3282"]
helpviewer_keywords: ["C3282"]
ms.assetid: bac2ac89-c360-4c24-bb81-c20c62ece9ba
---
# Compiler Error C3282

generic parameter lists can only appear on managed or WinRTclasses, structs, or functions
> generic parameter lists can only appear on managed or WinRTclasses, structs, or functions

## Remarks

A generic parameter list was used incorrectly. For more information, see [Generics](../../extensions/generics-cpp-component-extensions.md).

## Example

The following sample generates C3282 and shows how to fix it.
The following example generates C3282 and shows how to fix it.

```cpp
// C3282.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3283.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3283"
title: "Compiler Error C3283"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3283"
ms.date: 11/04/2016
f1_keywords: ["C3283"]
helpviewer_keywords: ["C3283"]
ms.assetid: c51d912c-cde3-4928-904e-26734c8954ce
---
# Compiler Error C3283

'type' : an interface cannot have an instance constructor
> 'type' : an interface cannot have an instance constructor

## Remarks

A CLR [interface](../../extensions/interface-class-cpp-component-extensions.md) cannot have an instance constructor. A static constructor is allowed.

The following sample generates C3283:
## Example

The following example generates C3283:

```cpp
// C3283.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3284.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3284"
title: "Compiler Error C3284"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3284"
ms.date: 11/04/2016
f1_keywords: ["C3284"]
helpviewer_keywords: ["C3284"]
ms.assetid: e582f316-e9db-4d27-9c70-fdfa737a9d5f
---
# Compiler Error C3284

the constraints for generic parameter 'parameter' of function 'function' must match the constraints for generic parameter 'parameter' of function 'function'
> the constraints for generic parameter 'parameter' of function 'function' must match the constraints for generic parameter 'parameter' of function 'function'

## Remarks

A virtual generic function must use the same constraints as a virtual function with the same name and set of arguments in the base class.

The following sample generates C3284:
## Example

The following example generates C3284:

```cpp
// C3284.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3285.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
description: "Learn more about: Compiler Error C3285"
title: "Compiler Error C3285"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3285"
ms.date: 11/04/2016
f1_keywords: ["C3285"]
helpviewer_keywords: ["C3285"]
ms.assetid: 04e8f210-d67e-4810-b153-e1efe2986c8f
---
# Compiler Error C3285

for each statement cannot operate on variables of type 'type'
> for each statement cannot operate on variables of type 'type'

## Remarks

The `for each` statement repeats a group of embedded statements for each element in an array or an object collection.

See [for each, in](../../dotnet/for-each-in.md) for more information.

## Example

The following sample generates C3285.
The following example generates C3285.

```cpp
// C3285.cpp
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3286.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3286"
title: "Compiler Error C3286"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3286"
ms.date: 11/04/2016
f1_keywords: ["C3286"]
helpviewer_keywords: ["C3286"]
ms.assetid: 554328c8-cf44-4f7d-a8d2-def74d28ecdd
---
# Compiler Error C3286

> '*specifier*': an iteration variable cannot have any storage-class specifiers

## Remarks

A storage class can't be specified on an iteration variable. For more information, see [Storage classes (C++)](../../cpp/storage-classes-cpp.md) and [for each, in](../../dotnet/for-each-in.md).

## Example

The following sample generates C3286, and also shows correct usage.
The following example generates C3286, and also shows correct usage.

```cpp
// C3286.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ description: "Describes Microsoft C++ compiler error C3287."
ms.date: 09/25/2020
f1_keywords: ["C3287"]
helpviewer_keywords: ["C3287"]
ms.assetid: c1fa73d2-2c82-4136-a7da-0e75e3b420ad
---
# Compiler Error C3287

Expand All @@ -18,7 +17,7 @@ For more information, see [for each, in](../../dotnet/for-each-in.md).

## Example

The following sample generates C3287.
The following example generates C3287.

```cpp
// C3287.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3288.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3288"
title: "Compiler Error C3288"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3288"
ms.date: 11/04/2016
f1_keywords: ["C3288"]
helpviewer_keywords: ["C3288"]
ms.assetid: ed08a540-9751-46e1-9cbe-c51d6a49ffab
---
# Compiler Error C3288

'type' : illegal dereference of a handle type
> 'type' : illegal dereference of a handle type

## Remarks

The compiler detected an illegal dereference of a handle type. You can dereference a handle type and assign it to a reference. For more information, see [Tracking Reference Operator](../../extensions/tracking-reference-operator-cpp-component-extensions.md).

## Example

The following sample generates C3288.
The following example generates C3288.

```cpp
// C3288.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3289.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3289"
title: "Compiler Error C3289"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3289"
ms.date: 11/04/2016
f1_keywords: ["C3289"]
helpviewer_keywords: ["C3289"]
ms.assetid: 3c1c623b-7fcf-43ab-a89a-8722532a8d29
---
# Compiler Error C3289

'property' : a trivial property cannot be indexed
> 'property' : a trivial property cannot be indexed

## Remarks

A property was declared incorrectly. Accessors must be defined for an indexed property. See [property](../../extensions/property-cpp-component-extensions.md) for more information.

## Example

The following sample generates C3289.
The following example generates C3289.

```cpp
// C3289.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3290.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
description: "Learn more about: Compiler Error C3290"
title: "Compiler Error C3290"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3290"
ms.date: 11/04/2016
f1_keywords: ["C3290"]
helpviewer_keywords: ["C3290"]
ms.assetid: 0baf684b-1143-4953-ac99-a2fa267d8017
---
# Compiler Error C3290

'type' : a trivial property cannot have reference type
> 'type' : a trivial property cannot have reference type

## Remarks

A property was declared incorrectly. When you declare a trivial property, the compiler creates a variable that the property will update, and it is not possible to have a tracking reference variable in a class.

See [property](../../extensions/property-cpp-component-extensions.md) and [Tracking Reference Operator](../../extensions/tracking-reference-operator-cpp-component-extensions.md) for more information.

## Example

The following sample generates C3290.
The following example generates C3290.

```cpp
// C3290.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3291.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3291"
title: "Compiler Error C3291"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3291"
ms.date: 11/04/2016
f1_keywords: ["C3291"]
helpviewer_keywords: ["C3291"]
ms.assetid: ed2e9f89-8dbc-4387-bc26-cc955e840858
---
# Compiler Error C3291

'default' : cannot be the name of a trivial property
> 'default' : cannot be the name of a trivial property

## Remarks

A trivial property cannot be named **`default`**. See [property](../../extensions/property-cpp-component-extensions.md) for more information.

## Example

The following sample generates C3291.
The following example generates C3291.

```cpp
// C3291.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3292.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3292"
title: "Compiler Error C3292"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3292"
ms.date: 11/04/2016
f1_keywords: ["C3292"]
helpviewer_keywords: ["C3292"]
ms.assetid: ead485cc-5471-4e10-b361-300589ff5b70
---
# Compiler Error C3292

the cli namespace cannot be reopened
> the cli namespace cannot be reopened

## Remarks

The cli namespace cannot be declared in your code. For more information, see [Platform, default, and cli Namespaces](../../extensions/platform-default-and-cli-namespaces-cpp-component-extensions.md).

## Example

The following sample generates C3292.
The following example generates C3292.

```cpp
// C3292.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3293.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
description: "Learn more about: Compiler Error C3293"
title: "Compiler Error C3293"
ms.date: "07/21/2017"
description: "Learn more about: Compiler Error C3293"
ms.date: 07/21/2017
f1_keywords: ["C3293"]
helpviewer_keywords: ["C3293"]
ms.assetid: b772cf98-52e0-4e24-be23-1f5d87d999ac
---
# Compiler Error C3293

'accessor': use 'default' to access the default property (indexer) for class 'type'
> 'accessor': use 'default' to access the default property (indexer) for class 'type'

## Remarks

An indexed property was accessed incorrectly. See [How to: Use Properties in C++/CLI](../../dotnet/how-to-use-properties-in-cpp-cli.md) for more information.

**Visual Studio 2017 and later**: In Visual Studio 2015 and earlier, the compiler in some cases misidentified a default property as a default indexer. It was possible to work around the issue by using the identifier "default" to access the property. The workaround itself became problematic after default was introduced as a keyword in C++11. Therefore, in Visual Studio 2017 the bugs that required the workaround were fixed, and the compiler now raises an error when "default" is used to access the default property for a class.

## Example

The following sample generates C3293 in Visual Studio 2015 and earlier.
The following example generates C3293 in Visual Studio 2015 and earlier.

```cpp
// C3293.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3296.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
description: "Learn more about: Compiler Error C3296"
title: "Compiler Error C3296"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3296"
ms.date: 11/04/2016
f1_keywords: ["C3296"]
helpviewer_keywords: ["C3296"]
ms.assetid: fc4c9dcd-16cf-4eee-a1ac-c43e7c29e443
---
# Compiler Error C3296

'property' : a property with this name already exists
> 'property' : a property with this name already exists

## Remarks

The compiler encountered more than one property with the same name. Each property in a type must have a unique name.

For more information, see [property](../../extensions/property-cpp-component-extensions.md).

## Example

The following sample generates C3296.
The following example generates C3296.

```cpp
// C3296.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3297.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
description: "Learn more about: Compiler Error C3297"
title: "Compiler Error C3297"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3297"
ms.date: 11/04/2016
f1_keywords: ["C3297"]
helpviewer_keywords: ["C3297"]
ms.assetid: 2a718b4c-6cdb-4418-92c0-fc3a259431c4
---
# Compiler Error C3297

'constraint_2' : cannot use 'constraint_1' as a constraint because 'constraint_1' has the value constraint
> 'constraint_2' : cannot use 'constraint_1' as a constraint because 'constraint_1' has the value constraint

## Remarks

Value classes are sealed. If a constraint is a value class, another constraint can never derive from it.

For more information, see [Constraints on Generic Type Parameters (C++/CLI)](../../extensions/constraints-on-generic-type-parameters-cpp-cli.md).

## Example

The following sample generates C3297.
The following example generates C3297.

```cpp
// C3297.cpp
Expand Down
Loading