Skip to content
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-c3803.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3803"
title: "Compiler Error C3803"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3803"
ms.date: 11/04/2016
f1_keywords: ["C3803"]
helpviewer_keywords: ["C3803"]
ms.assetid: bad5fb9a-ed9a-4c15-96e7-cf06e200a50d
---
# Compiler Error C3803

'property': property has a type that is incompatible with one of its accessors 'accessor'
> 'property': property has a type that is incompatible with one of its accessors 'accessor'

## Remarks

The type of a property defined with [property](../../cpp/property-cpp.md) does not match the return type for one of its accessor functions.

The following sample generates C3803:
## Example

The following example generates C3803:

```cpp
// C3803.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3804.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
description: "Learn more about: Compiler Error C3804"
title: "Compiler Error C3804"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3804"
ms.date: 11/04/2016
f1_keywords: ["C3804"]
helpviewer_keywords: ["C3804"]
ms.assetid: 7c4cda28-ec96-4d04-937b-36dbd9944722
---
# Compiler Error C3804

'property_accessor': the accessor methods for a property must either be all static or all non-static
> 'property_accessor': the accessor methods for a property must either be all static or all non-static

## Remarks

When defining a non-trivial property, the accessor functions can be either static or instance, but not both.

See [property](../../extensions/property-cpp-component-extensions.md) for more information.

## Example

The following sample generates C3804.
The following example generates C3804.

```cpp
// C3804.cpp
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3805.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Error C3805"
title: "Compiler Error C3805"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3805"
ms.date: 11/04/2016
f1_keywords: ["C3805"]
helpviewer_keywords: ["C3805"]
ms.assetid: 166bbc35-5488-46b4-8e4c-9cd26ee5644e
---
# Compiler Error C3805

'token' : unexpected token, expected either '}' or an identifier
> 'token' : unexpected token, expected either '}' or an identifier

## Remarks

When defining a property, an invalid token was encountered. Remove the invalid token.
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3807.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3807"
title: "Compiler Error C3807"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3807"
ms.date: 11/04/2016
f1_keywords: ["C3807"]
helpviewer_keywords: ["C3807"]
ms.assetid: 7e2b0aab-8c61-4e71-b9c1-fcaeb6a1b5ea
---
# Compiler Error C3807

'type' : a class with the ComImport attribute cannot derive from 'type2', only interface implementation is allowed
> 'type' : a class with the ComImport attribute cannot derive from 'type2', only interface implementation is allowed

## Remarks

A type that derived from <xref:System.Runtime.InteropServices.ComImportAttribute> can only implement an interface.

## Example

The following sample generates C3807.
The following example generates C3807.

```cpp
// C3807.cpp
Expand Down
7 changes: 3 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3808.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Error C3808"
title: "Compiler Error C3808"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3808"
ms.date: 11/04/2016
f1_keywords: ["C3808"]
helpviewer_keywords: ["C3808"]
ms.assetid: 2ee8ac97-3ea4-417a-8710-be73a7f98cf4
---
# Compiler Error C3808

Expand All @@ -18,7 +17,7 @@ The **/clr:pure** and **/clr:safe** compiler options are deprecated in Visual St

## Example

The following sample generates C3808.
The following example generates C3808.

```cpp
// C3808.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3809.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3809"
title: "Compiler Error C3809"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3809"
ms.date: 11/04/2016
f1_keywords: ["C3809"]
helpviewer_keywords: ["C3809"]
ms.assetid: 37eca584-c20c-464e-8e45-a987214b7ce4
---
# Compiler Error C3809

'class' : a managed or WinRT type cannot have any friend functions/classes/interfaces
> 'class' : a managed or WinRT type cannot have any friend functions/classes/interfaces

## Remarks

Managed types and Windows Runtime types do not allow friends. To fix this error, do not declare friends inside managed or Windows Runtime types.

The following sample generates C3809:
## Example

The following example generates C3809:

```cpp
// C3809a.cpp
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3812.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Compiler Error C3812"
title: "Compiler Error C3812"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3812"
ms.date: 11/04/2016
f1_keywords: ["C3812"]
helpviewer_keywords: ["C3812"]
ms.assetid: 326ac706-9a5f-4851-b9d2-b90c64c75532
---
# Compiler Error C3812

'property' must be the first token in a property declaration
> 'property' must be the first token in a property declaration

## Remarks

When declaring a property, the `__property` keyword must be the first token on the line.

Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3813.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3813"
title: "Compiler Error C3813"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3813"
ms.date: 11/04/2016
f1_keywords: ["C3813"]
helpviewer_keywords: ["C3813"]
ms.assetid: ffdbc489-71bf-4cd6-988c-f824c9ab3ceb
---
# Compiler Error C3813

a property declaration can only appear within the definition of a managed or WinRT type
> a property declaration can only appear within the definition of a managed or WinRT type

## Remarks

A [property](../../dotnet/how-to-use-properties-in-cpp-cli.md) can only be declared within a managed or Windows Runtime type. Native types do not support the **`property`** keyword.

## Example

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

```cpp
// C3813.cpp
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3815.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Compiler Error C3815"
title: "Compiler Error C3815"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3815"
ms.date: 11/04/2016
f1_keywords: ["C3815"]
helpviewer_keywords: ["C3815"]
ms.assetid: c5a3b404-6341-4fd3-92af-152b404c4dde
---
# Compiler Error C3815

return type of method 'get_accessor' must match type of the last parameter of a setter
> return type of method 'get_accessor' must match type of the last parameter of a setter

## Remarks

When declaring properties, the return value of the `get_accessor` method must match the last parameter in the declaration of the set accessor method.

Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3816.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3816"
title: "Compiler Error C3816"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3816"
ms.date: 11/04/2016
f1_keywords: ["C3816"]
helpviewer_keywords: ["C3816"]
ms.assetid: 2e52cc7f-e31c-41a3-8d6f-9f5fab3648c0
---
# Compiler Error C3816

'declaration' was previously declared or defined with a different managed or WinRTmodifier
> 'declaration' was previously declared or defined with a different managed or WinRTmodifier

## Remarks

A forward declaration and an actual declaration require that there be no conflicts or inconsistencies in the declaration of attributes.

The following sample generates C3816 and shows how to fix it:
## Example

The following example generates C3816 and shows how to fix it:

```cpp
// C3816a.cpp
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3817.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Compiler Error C3817"
title: "Compiler Error C3817"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3817"
ms.date: 11/04/2016
f1_keywords: ["C3817"]
helpviewer_keywords: ["C3817"]
ms.assetid: c6dbb57a-c65e-4040-8dd2-85bd9d4fd337
---
# Compiler Error C3817

'declaration' : property can only be applied to a function
> 'declaration' : property can only be applied to a function

## Remarks

The **`property`** keyword can only be a applied to a function definition.

Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3818.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Compiler Error C3818"
title: "Compiler Error C3818"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3818"
ms.date: 11/04/2016
f1_keywords: ["C3818"]
helpviewer_keywords: ["C3818"]
ms.assetid: f9502f6a-0690-4135-ab88-cc97cf490f5c
---
# Compiler Error C3818

array property declaration 'property1' shall not overload an index property 'property2'
> array property declaration 'property1' shall not overload an index property 'property2'

## Remarks

An overload is not possible for properties when one is an indexer and the other is an array property.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ description: "Microsoft C/C++ compiler error C3820 causes and remedies."
ms.date: 09/26/2020
f1_keywords: ["C3820"]
helpviewer_keywords: ["C3820"]
ms.assetid: 98638838-068f-4a62-b8d5-1068368a0ff1
---
# Compiler Error C3820

Expand Down
13 changes: 7 additions & 6 deletions docs/error-messages/compiler-errors-2/compiler-error-c3821.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
description: "Learn more about: Compiler Error C3821"
title: "Compiler Error C3821"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3821"
ms.date: 11/04/2016
f1_keywords: ["C3821"]
helpviewer_keywords: ["C3821"]
ms.assetid: 2b327c7a-5faf-443c-ae82-944fae25b4df
---
# Compiler Error C3821

'function': managed type or function cannot be used in an unmanaged function
> 'function': managed type or function cannot be used in an unmanaged function

## Remarks

Functions with inline assembly or [setjmp](../../c-runtime-library/reference/setjmp.md) cannot contain value types or managed classes. To fix this error, remove the inline assembly and `setjmp` or remove the managed objects.

C3821 can also occur if you try to use automatic storage in a vararg function. For more information, see [Variable Argument Lists (...) (C++/CLI)](../../extensions/variable-argument-lists-dot-dot-dot-cpp-cli.md) and [C++ Stack Semantics for Reference Types](../../dotnet/cpp-stack-semantics-for-reference-types.md).

## Examples

The following sample generates C3821.
The following example generates C3821.

```cpp
// C3821a.cpp
Expand All @@ -27,7 +28,7 @@ void test1(...) {
}
```

The following sample generates C3821.
The following example generates C3821.

```cpp
// C3821b.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3824.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3824"
title: "Compiler Error C3824"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3824"
ms.date: 11/04/2016
f1_keywords: ["C3824"]
helpviewer_keywords: ["C3824"]
ms.assetid: b6c6adf1-0a29-401c-a06e-616fd50d4c37
---
# Compiler Error C3824

'member': this type cannot appear in this context (function parameter, return type, or a static member)
> 'member': this type cannot appear in this context (function parameter, return type, or a static member)

## Remarks

Pinning pointers cannot be function parameters, return types, or declared **`static`**.

## Example

The following sample generates C3824:
The following example generates C3824:

```cpp
// C3824a.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3825.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3825"
title: "Compiler Error C3825"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3825"
ms.date: 11/04/2016
f1_keywords: ["C3825"]
helpviewer_keywords: ["C3825"]
ms.assetid: 18e204a1-f26e-42c6-8d74-2b49cc95f940
---
# Compiler Error C3825

'class': a managed or WinRTclass can only support managed or WinRTevents
> 'class': a managed or WinRTclass can only support managed or WinRTevents

## Remarks

Only .NET events are supported in managed classes. Only Windows Runtime events are supported in Windows Runtime classes. To fix this error in managed code, change type parameter of `event_source` and `event_receiver` from `native` to `managed`. Alternatively, remove the attribute.

## Example

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

```cpp
// C3825a.cpp
Expand Down
Loading