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-c3421.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
description: "Learn more about: Compiler Error C3421"
title: "Compiler Error C3421"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3421"
ms.date: 11/04/2016
f1_keywords: ["C3421"]
helpviewer_keywords: ["C3421"]
ms.assetid: b52050c6-17a4-424a-8894-337b0cec7010
---
# Compiler Error C3421

'type' : you cannot call the finalizer for this class as it is either inaccessible or it does not exist
> 'type' : you cannot call the finalizer for this class as it is either inaccessible or it does not exist

## Remarks

A finalizer is implicitly private, so it cannot be called from outside its enclosing type.

For more information, see [Destructors and finalizers in How to: Define and consume classes and structs (C++/CLI)](../../dotnet/how-to-define-and-consume-classes-and-structs-cpp-cli.md#BKMK_Destructors_and_finalizers).

## Example

The following sample generates C3421.
The following example generates C3421.

```cpp
// C3421.cpp
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3445.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
description: "Learn more about: Compiler Error C3445"
title: "Compiler Error C3445"
ms.date: "04/10/2017"
description: "Learn more about: Compiler Error C3445"
ms.date: 04/10/2017
f1_keywords: ["C3445"]
helpviewer_keywords: ["C3445"]
ms.assetid: 0d272bfc-136b-4025-a9ba-5e4eea5f8215
---
# Compiler Error C3445

> copy-list-initialization of '*type*' cannot use an explicit constructor

## Remarks

According to the ISO C++17 standard, the compiler is required to consider an explicit constructor for overload resolution in copy-list-initialization, but must raise an error if that overload is actually chosen.

Starting in Visual Studio 2017, the compiler finds errors related to object creation by using an initializer list that were not found by Visual Studio 2015. These errors could lead to crashes or undefined behavior at runtime.

## Example

The following sample generates C3445.
The following example generates C3445.

```cpp
// C3445.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3446.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3446"
title: "Compiler Error C3446"
ms.date: "07/21/2017"
description: "Learn more about: Compiler Error C3446"
ms.date: 07/21/2017
f1_keywords: ["C3446"]
helpviewer_keywords: ["C3446"]
ms.assetid: 33064548-24e4-46f1-beb1-476e3c3b3fbf
---
# Compiler Error C3446

>'*class*': a default member initializer is not allowed for a member of a value class
> '*class*': a default member initializer is not allowed for a member of a value class

## Remarks

In Visual Studio 2015 and earlier, the compiler permitted (but ignored) a default member initializer for a member of a value class. Default initialization of a value class always zero-initializes the members; a default constructor is not permitted. In Visual Studio 2017, default member initializers raise a compiler error, as shown in this example:

## Example

The following sample generates C3446 in Visual Studio 2017 and later:
The following example generates C3446 in Visual Studio 2017 and later:

```cpp
// C3446.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3450.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
description: "Learn more about: Compiler Error C3450"
title: "Compiler Error C3450"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3450"
ms.date: 11/04/2016
f1_keywords: ["C3450"]
helpviewer_keywords: ["C3450"]
ms.assetid: 78892cf7-0b82-4589-90d0-e06666247003
---
# Compiler Error C3450

'type': not an attribute; cannot specify [System::AttributeUsageAttribute] or [Windows::Foundation::Metadata::AttributeUsageAttribute]
> 'type': not an attribute; cannot specify [System::AttributeUsageAttribute] or [Windows::Foundation::Metadata::AttributeUsageAttribute]

## Remarks

A user-defined managed attribute must inherit from <xref:System.ComponentModel.AttributeCollection.%23ctor%2A>. A Windows Runtime attribute must be defined in the `Windows::Foundation::Metadata` namespace.

For more information, see [User-Defined Attributes](../../extensions/user-defined-attributes-cpp-component-extensions.md).

## Example

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

```cpp
// C3450.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3451.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Compiler Error C3451"
title: "Compiler Error C3451"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3451"
ms.date: 11/04/2016
f1_keywords: ["C3451"]
helpviewer_keywords: ["C3451"]
ms.assetid: a4897a69-e3e7-40bb-bb1c-598644904012
---
# Compiler Error C3451

'attribute': cannot apply unmanaged attribute to 'type'
> 'attribute': cannot apply unmanaged attribute to 'type'

## Remarks

A C++ attribute cannot be applied to a CLR type. See [C++ Attributes Reference](../../windows/attributes/attributes-alphabetical-reference.md) for more information.

Expand All @@ -18,7 +19,7 @@ This error can be generated as a result of compiler conformance work that was do

## Example

The following sample generates C3451.
The following example generates C3451.

```cpp
// C3451.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3452.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3452"
title: "Compiler Error C3452"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3452"
ms.date: 11/04/2016
f1_keywords: ["C3452"]
helpviewer_keywords: ["C3452"]
ms.assetid: e5293dcf-cb70-4133-ae2a-0bb496950ba0
---
# Compiler Error C3452

list argument member not constant
> list argument member not constant

## Remarks

An argument was passed to an attribute that expected a constant, a value that can be evaluated at compile time.

## Example

The following sample generates C3452.
The following example generates C3452.

```cpp
// C3452.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3453.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3453"
title: "Compiler Error C3453"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3453"
ms.date: 11/04/2016
f1_keywords: ["C3453"]
helpviewer_keywords: ["C3453"]
ms.assetid: dbefdbcf-f697-4239-b7a5-1d99b85e9e7f
---
# Compiler Error C3453

'attribute': attribute not applied because qualifier 'assembly' did not match
> 'attribute': attribute not applied because qualifier 'assembly' did not match

## Remarks

Assembly or module level attributes can only be specified as stand-alone instructions.

## Example

The following sample generates C3453.
The following example generates C3453.

```cpp
// C3453.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3454.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
description: "Learn more about: Compiler Error C3454"
title: "Compiler Error C3454"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3454"
ms.date: 11/04/2016
f1_keywords: ["C3454"]
helpviewer_keywords: ["C3454"]
ms.assetid: dc4e6d57-5b4d-4114-8d6f-22f9ae62925b
---
# Compiler Error C3454

[attribute] not allowed on class declaration
> [attribute] not allowed on class declaration

## Remarks

A class must be defined for it to be an attribute.

For more information, see [attribute](../../windows/attributes/attribute.md).

## Example

The following sample generates C3454.
The following example generates C3454.

```cpp
// C3454.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3455.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3455"
title: "Compiler Error C3455"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3455"
ms.date: 11/04/2016
f1_keywords: ["C3455"]
helpviewer_keywords: ["C3455"]
ms.assetid: 218e5cfe-5391-4eeb-81c2-85c47e3a6cd2
---
# Compiler Error C3455

'attribute': none of the attribute constructors matched the arguments
> 'attribute': none of the attribute constructors matched the arguments

## Remarks

An invalid value was used to declare an attribute. See [attribute](../../windows/attributes/attribute.md) for more information.

## Example

The following sample generates C3455.
The following example generates C3455.

```cpp
// C3455.cpp
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3456.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Compiler Error C3456"
title: "Compiler Error C3456"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3456"
ms.date: 11/04/2016
f1_keywords: ["C3456"]
helpviewer_keywords: ["C3456"]
ms.assetid: 9f781919-aaf2-4725-94a4-44a0b80cc64a
---
# Compiler Error C3456

[source_annotation_attribute] not allowed on managed or WinRT class declaration
> [source_annotation_attribute] not allowed on managed or WinRT class declaration

## Remarks

source_annotation_attribute is used to define custom attributes to be used by code analysis.

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

'attribute': attribute does not support unnamed arguments
> 'attribute': attribute does not support unnamed arguments

## Remarks

Source annotation attributes, unlike CLR custom attribute or compiler attributes, only support named arguments.

## Example

The following sample generates C3457.
The following example generates C3457.

```cpp
#include "SourceAnnotations.h"
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3458.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3458"
title: "Compiler Error C3458"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3458"
ms.date: 11/04/2016
f1_keywords: ["C3458"]
helpviewer_keywords: ["C3458"]
ms.assetid: 940202fd-8dcc-4042-9c96-3f9e9127d2f1
---
# Compiler Error C3458

'attribute1': attribute 'attribute2' already specified for 'construct'
> 'attribute1': attribute 'attribute2' already specified for 'construct'

## Remarks

Two attributes that are mutually exclusive were specified for the same construct.

## Example

The following sample generates C3458
The following example generates C3458

```cpp
// C3458.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3459.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
description: "Learn more about: Compiler Error C3459"
title: "Compiler Error C3459"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3459"
ms.date: 11/04/2016
f1_keywords: ["C3459"]
helpviewer_keywords: ["C3459"]
ms.assetid: 3d290a20-d313-4c07-9bd8-c5c159cb169f
---
# Compiler Error C3459

'attribute': attribute allowed only on class indexer (default indexed property)
> 'attribute': attribute allowed only on class indexer (default indexed property)

## Remarks

An attribute that is designed to be applied to a class indexer property was used incorrectly.

For more information, see [How to: Use Properties in C++/CLI](../../dotnet/how-to-use-properties-in-cpp-cli.md).

## Example

The following sample generates C3459.
The following example generates C3459.

```cpp
// C3459.cpp
Expand Down
15 changes: 8 additions & 7 deletions docs/error-messages/compiler-errors-2/compiler-error-c3460.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
---
description: "Learn more about: Compiler Error C3460"
title: "Compiler Error C3460"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3460"
ms.date: 11/04/2016
f1_keywords: ["C3460"]
helpviewer_keywords: ["C3460"]
ms.assetid: adbf8775-10ca-4654-acdf-58dd765351cd
---
# Compiler Error C3460

'type': only a user-defined type can be forwarded
> 'type': only a user-defined type can be forwarded

## Remarks

For more information, see [Type Forwarding (C++/CLI)](../../extensions/type-forwarding-cpp-cli.md).

## Examples
## Example

The following sample creates a component.
The following example creates a component.

```cpp
// C3460.cpp
// compile with: /LD /clr
public ref class R {};
```

The following sample generates C3460.
The following example generates C3460.

```cpp
// C3460_b.cpp
Expand Down
Loading