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
2 changes: 1 addition & 1 deletion docs/error-messages/compiler-warnings/c4698.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: "Learn about the cause and fixes for Compiler warning (level 3) C4698."
title: "Compiler warning (Level 4) C4698"
description: "Learn about the cause and fixes for Compiler warning (level 3) C4698."
ms.date: 04/18/2021
f1_keywords: ["C4698"]
helpviewer_keywords: ["C4698"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Warning C4687"
title: "Compiler Warning C4687"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning C4687"
ms.date: 11/04/2016
f1_keywords: ["C4687"]
helpviewer_keywords: ["C4687"]
ms.assetid: 2f28e0b1-7358-4c88-bd70-aad8f0aa004c
---
# Compiler Warning C4687

Expand All @@ -20,7 +19,7 @@ C4687 is issued as an error by default. You can suppress C4687 with the [warning

## Example

The following sample generates C4687.
The following example generates C4687.

```cpp
// C4687.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
description: "Learn more about: Compiler Warning C4693"
title: "Compiler Warning C4693"
ms.date: "10/25/2017"
description: "Learn more about: Compiler Warning C4693"
ms.date: 10/25/2017
f1_keywords: ["C4693"]
helpviewer_keywords: ["C4693"]
ms.assetid: 72d8db01-5e6f-4794-8731-76107e8f064a
---
# Compiler Warning C4693

> 'class': a sealed abstract class cannot have any instance members 'Test'

## Remarks

If a type is marked [sealed](../../extensions/sealed-cpp-component-extensions.md) and [abstract](../../extensions/abstract-cpp-component-extensions.md), it can only have static members.

This warning is automatically promoted to an error. If you wish to modify this behavior, use [#pragma warning](../../preprocessor/warning.md).

## Example

The following sample generates C4693.
The following example generates C4693.

```cpp
// C4693.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
description: "Learn more about: Compiler Warning C4694"
title: "Compiler Warning C4694"
ms.date: "10/25/2017"
description: "Learn more about: Compiler Warning C4694"
ms.date: 10/25/2017
f1_keywords: ["C4694"]
helpviewer_keywords: ["C4694"]
ms.assetid: 5ca122bb-34f3-43ee-a21f-95802cd515f7
---
# Compiler Warning C4694

> '*class*': a sealed abstract class cannot have a base-class '*base_class*'

## Remarks

An abstract and sealed class cannot inherit from a reference type; a sealed and abstract class can neither implement the base class functions nor allow itself to be used as a base class.

For more information, see [abstract](../../extensions/abstract-cpp-component-extensions.md), [sealed](../../extensions/sealed-cpp-component-extensions.md), and [Classes and Structs](../../extensions/classes-and-structs-cpp-component-extensions.md).
Expand All @@ -18,7 +19,7 @@ This warning is automatically promoted to an error. If you wish to modify this b

## Example

The following sample generates C4694.
The following example generates C4694.

```cpp
// C4694.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Warning (level 1 and level 4) C4700"
title: "Compiler Warning (level 1 and level 4) C4700"
description: "Learn more about: Compiler Warning (level 1 and level 4) C4700"
ms.date: 08/30/2022
f1_keywords: ["C4700"]
helpviewer_keywords: ["C4700"]
ms.assetid: 2da0deb4-77dd-4b05-98d3-b78d74ac4ca7
---
# Compiler Warning (level 1 and level 4) C4700

Expand All @@ -20,7 +19,7 @@ The [`/sdl` (Enable Additional Security Checks)](../../build/reference/sdl-enabl

## Example

This sample generates C4700 when variables `t`, `u`, and `v` are used before they're initialized, and shows the kind of garbage value that can result. Variables `x`, `y`, and `z` don't cause the warning, because they're initialized before use:
This example generates C4700 when variables `t`, `u`, and `v` are used before they're initialized, and shows the kind of garbage value that can result. Variables `x`, `y`, and `z` don't cause the warning, because they're initialized before use:

```cpp
// c4700.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
---
description: "Learn more about: Compiler Warning (level 1) C4661"
title: "Compiler Warning (level 1) C4661"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4661"
ms.date: 11/04/2016
f1_keywords: ["C4661"]
helpviewer_keywords: ["C4661"]
ms.assetid: 603bb8b7-356d-4eef-924b-64d769bac5bd
---
# Compiler Warning (level 1) C4661

'identifier' : no suitable definition provided for explicit template instantiation request
> 'identifier' : no suitable definition provided for explicit template instantiation request

## Remarks

A member of the template class is not defined.

## Example

The following example generates C4661:

```cpp
// C4661.cpp
// compile with: /W1 /LD
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
---
description: "Learn more about: Compiler Warning (level 1) C4662"
title: "Compiler Warning (level 1) C4662"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4662"
ms.date: 11/04/2016
f1_keywords: ["C4662"]
helpviewer_keywords: ["C4662"]
ms.assetid: 7efda273-d04a-47b7-ad65-ff1ff94b5ffc
---
# Compiler Warning (level 1) C4662

explicit instantiation; template-class 'identifier1' has no definition from which to specialize 'identifier2'
> explicit instantiation; template-class 'identifier1' has no definition from which to specialize 'identifier2'
## Remarks

The specified template-class was declared, but not defined.

## Example

The following example generates C4662:

```cpp
// C4662.cpp
// compile with: /W1 /LD
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Warning (level 1) C4667"
title: "Compiler Warning (level 1) C4667"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4667"
ms.date: 11/04/2016
f1_keywords: ["C4667"]
helpviewer_keywords: ["C4667"]
ms.assetid: 5d2b7fe0-4f0e-4cd6-b432-ca02c3d194ab
---
# Compiler Warning (level 1) C4667

'function' : no function template defined that matches forced instantiation
> 'function' : no function template defined that matches forced instantiation

## Remarks

You cannot instantiate a function template that has not been declared.

The following sample will cause C4667:
## Example

The following example will cause C4667:

```cpp
// C4667a.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Warning (level 1) C4669"
title: "Compiler Warning (level 1) C4669"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4669"
ms.date: 11/04/2016
f1_keywords: ["C4669"]
helpviewer_keywords: ["C4669"]
ms.assetid: 97730679-e3dc-44d4-b2a8-aa65badc17f2
---
# Compiler Warning (level 1) C4669

'cast' : unsafe conversion: 'class' is a managed or WinRT type object
> 'cast' : unsafe conversion: 'class' is a managed or WinRT type object

## Remarks

A cast contains a Windows Runtime or managed type. The compiler completes the cast by performing a bit-wise copy of one pointer to the other, but provides no other checking. To resolve this warning, do not cast classes containing managed members or Windows Runtime types.

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

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

```cpp
// C4669.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Warning (level 1) C4674"
title: "Compiler Warning (level 1) C4674"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4674"
ms.date: 11/04/2016
f1_keywords: ["C4674"]
helpviewer_keywords: ["C4674"]
ms.assetid: 638dae0b-b82c-4865-9599-72630827ca09
---
# Compiler Warning (level 1) C4674

'method' should be declared 'static' and have exactly one parameter
> 'method' should be declared 'static' and have exactly one parameter

## Remarks

The signature of a conversion operator was not correct. The method is not considered a user-defined conversion. For more information on defining operators, see [User-Defined Operators (C++/CLI)](../../dotnet/user-defined-operators-cpp-cli.md) and [User-Defined Conversions (C++/CLI)](../../dotnet/user-defined-conversions-cpp-cli.md).

## Example

The following sample generates C4674.
The following example generates C4674.

```cpp
// C4674.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Warning (level 1) C4677"
title: "Compiler Warning (level 1) C4677"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4677"
ms.date: 11/04/2016
f1_keywords: ["C4677"]
helpviewer_keywords: ["C4677"]
ms.assetid: a8d656a1-e2ff-4f8b-9028-201765131026
---
# Compiler Warning (level 1) C4677

'function': signature of non-private member contains assembly private type 'private_type'
> 'function': signature of non-private member contains assembly private type 'private_type'

## Remarks

A type that has public accessibility outside the assembly uses a type that has private access outside the assembly. A component that references the public assembly type will not be able to use the type member or members that reference the assembly private type.

## Example

The following sample generates C4677.
The following example generates C4677.

```cpp
// C4677.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Compiler Warning (level 1) C4678"
title: "Compiler Warning (level 1) C4678"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4678"
ms.date: 11/04/2016
f1_keywords: ["C4678"]
helpviewer_keywords: ["C4678"]
ms.assetid: 0c588f34-595d-4e5c-9470-8723fca2cc06
---
# Compiler Warning (level 1) C4678

base class 'base_type' is less accessible than 'derived_type'
> base class 'base_type' is less accessible than 'derived_type'

## Remarks

A public type derives from a private type. If the public type is instantiated in a referenced assembly, members of the private base type will not be accessible.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
description: "Learn more about: Compiler Warning (level 1) C4679"
title: "Compiler Warning (level 1) C4679"
ms.date: "08/27/2018"
description: "Learn more about: Compiler Warning (level 1) C4679"
ms.date: 08/27/2018
f1_keywords: ["C4679"]
helpviewer_keywords: ["C4679"]
ms.assetid: 3cc74150-42a8-4116-94cd-4ef0fd6dcf32
---
# Compiler Warning (level 1) C4679

> '*member*' : could not import member

## Remarks

The compiler encountered a construct that it cannot support, that cannot be imported from metadata.

Do not try to use the construct.
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Warning (level 1) C4683"
title: "Compiler Warning (level 1) C4683"
ms.date: "08/27/2018"
description: "Learn more about: Compiler Warning (level 1) C4683"
ms.date: 08/27/2018
f1_keywords: ["C4683"]
helpviewer_keywords: ["C4683"]
ms.assetid: e6e77364-dba1-46dd-ae1d-03da23070bce
---
# Compiler Warning (level 1) C4683

Expand All @@ -24,7 +23,7 @@ The reason for the leak is that the out parameter will be set by more than one h

## Example

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

```cpp
// C4683.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Warning (level 1) C4684"
title: "Compiler Warning (level 1) C4684"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4684"
ms.date: 11/04/2016
f1_keywords: ["C4684"]
helpviewer_keywords: ["C4684"]
ms.assetid: e95f1a83-2784-4b05-ae94-12148e056e26
---
# Compiler Warning (level 1) C4684

'attribute' : WARNING!! attribute may cause invalid code generation: use with caution
> 'attribute' : WARNING!! attribute may cause invalid code generation: use with caution

## Remarks

You used an attribute that should not commonly be used.

The following sample generates C4684:
## Example

The following example generates C4684:

```cpp
// C4684.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Warning (level 1) C4685"
title: "Compiler Warning (level 1) C4685"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4685"
ms.date: 11/04/2016
f1_keywords: ["C4685"]
helpviewer_keywords: ["C4685"]
ms.assetid: 16e859b8-a8e8-4a0d-a1d0-37ec4e59a9d7
---
# Compiler Warning (level 1) C4685

expecting '> >' found '>>' when parsing template parameters
> expecting '> >' found '>>' when parsing template parameters

## Remarks

A template definition was not terminated correctly.
Loading