Skip to content

Structure error references in range [C2291, C2320] #5570

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
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/compiler-error-c2292.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Compiler Error C2292"
title: "Compiler Error C2292"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2292"
ms.date: 11/04/2016
f1_keywords: ["C2292"]
helpviewer_keywords: ["C2292"]
ms.assetid: 256b392f-2b8f-4162-b578-e7633984e162
---
# Compiler Error C2292

'identifier': best case inheritance representation: 'representation1' declared but 'representation2' required
> 'identifier': best case inheritance representation: 'representation1' declared but 'representation2' required

## Example

Compiling the following code with [/vmb](../../build/reference/vmb-vmg-representation-method.md) ("Best-case always" representation) causes C2292.

Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-1/compiler-error-c2293.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C2293"
title: "Compiler Error C2293"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2293"
ms.date: 11/04/2016
f1_keywords: ["C2293"]
helpviewer_keywords: ["C2293"]
ms.assetid: 17e7b4e2-368b-4dd7-a01b-d82be60f8e56
---
# Compiler Error C2293

'identifier': illegal to have a member variable as a __based specifier
> 'identifier': illegal to have a member variable as a __based specifier

## Remarks

Specifiers for **`__based`** modifier must be nonmember pointers.

The following sample generates C2293:
## Example

The following example generates C2293:

```cpp
// C2293.cpp
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/compiler-error-c2295.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Error C2295"
title: "Compiler Error C2295"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2295"
ms.date: 11/04/2016
f1_keywords: ["C2295"]
helpviewer_keywords: ["C2295"]
ms.assetid: faddf446-5924-401e-b719-93390d5cd084
---
# Compiler Error C2295

escaped 'character' : is illegal in macro definition
> escaped 'character' : is illegal in macro definition

## Remarks

A macro definition cannot contain an escape sequence with the specified character.
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-1/compiler-error-c2296.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
---
description: "Learn more about: Compiler Error C2296"
title: "Compiler Error C2296"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2296"
ms.date: 11/04/2016
f1_keywords: ["C2296"]
helpviewer_keywords: ["C2296"]
ms.assetid: 47d270f4-13ce-4c16-81e2-7d67c6c4a540
---
# Compiler Error C2296

'operator' : bad left operand
> 'operator' : bad left operand

## Remarks

The left operand used with `operator` is invalid.

For example, the compiler may see a declaration where you intended a function call.

The following sample generates C2296:
## Example

The following example generates C2296:

```cpp
// C2296.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-1/compiler-error-c2297.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
---
description: "Learn more about: Compiler Error C2297"
title: "Compiler Error C2297"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2297"
ms.date: 11/04/2016
f1_keywords: ["C2297"]
helpviewer_keywords: ["C2297"]
ms.assetid: 65849fe5-17e1-4b7e-b50c-f508b05ddaa4
---
# Compiler Error C2297

'operator' : bad right operand
> 'operator' : bad right operand

## Remarks

The right operand used with `operator` is invalid.

For example, the compiler may see a declaration where you intended a function call.

The following sample generates C2297:
## Example

The following example generates C2297:

```cpp
// C2297.cpp
Expand Down
13 changes: 7 additions & 6 deletions docs/error-messages/compiler-errors-1/compiler-error-c2298.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C2298"
title: "Compiler Error C2298"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2298"
ms.date: 11/04/2016
f1_keywords: ["C2298"]
helpviewer_keywords: ["C2298"]
ms.assetid: eb0120ad-c850-4bdd-911d-0361229cc859
---
# Compiler Error C2298

'operation' : illegal operation on pointer to member function expression
> 'operation' : illegal operation on pointer to member function expression

## Remarks

A pointer to member-function expression must call the member function.

## Examples

The following sample generates C2298.
The following example generates C2298.

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

The following sample generates C2298.
The following example generates C2298.

```cpp
// C2298_b.cpp
Expand Down
7 changes: 3 additions & 4 deletions docs/error-messages/compiler-errors-1/compiler-error-c2299.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Error C2299"
title: "Compiler Error C2299"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2299"
ms.date: 11/04/2016
f1_keywords: ["C2299"]
helpviewer_keywords: ["C2299"]
ms.assetid: d001c2bc-f6fd-47aa-8e42-0eb824d6441d
---
# Compiler Error C2299

Expand All @@ -18,7 +17,7 @@ To resolve C2299, don't make the copy constructor or assignment operator a funct

## Example

The following sample generates C2299:
The following example generates C2299:

```cpp
// C2299.cpp
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/compiler-error-c2300.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Error C2300"
title: "Compiler Error C2300"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2300"
ms.date: 11/04/2016
f1_keywords: ["C2300"]
helpviewer_keywords: ["C2300"]
ms.assetid: bb8fed56-feb0-412b-ae7b-04d48b202b78
---
# Compiler Error C2300

'identifier' : class does not have a destructor called '~identifier'
> 'identifier' : class does not have a destructor called '~identifier'

## Remarks

The class does not have a destructor with the required name.
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/compiler-error-c2301.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Error C2301"
title: "Compiler Error C2301"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2301"
ms.date: 11/04/2016
f1_keywords: ["C2301"]
helpviewer_keywords: ["C2301"]
ms.assetid: d294a1a2-dc7a-4e18-90b3-747e1a8c51ee
---
# Compiler Error C2301

left of '->~identifier' must point to class/struct/union
> left of '->~identifier' must point to class/struct/union

## Remarks

The expression to the left of the `->` operator does not evaluate to a pointer to a class, structure, or union.
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/compiler-error-c2302.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Error C2302"
title: "Compiler Error C2302"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2302"
ms.date: 11/04/2016
f1_keywords: ["C2302"]
helpviewer_keywords: ["C2302"]
ms.assetid: 74a54bab-9d5c-446e-9b1f-c92fb57090a8
---
# Compiler Error C2302

left of '.~identifier' must have class/struct/union type
> left of '.~identifier' must have class/struct/union type

## Remarks

The expression to the left of the period (.) operator is not a class, structure, or union.
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/compiler-error-c2307.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Error C2307"
title: "Compiler Error C2307"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2307"
ms.date: 11/04/2016
f1_keywords: ["C2307"]
helpviewer_keywords: ["C2307"]
ms.assetid: ce6c8033-a673-4679-9883-bedec36ae385
---
# Compiler Error C2307

pragma 'pragma' must be outside function if incremental compilation is enabled
> pragma 'pragma' must be outside function if incremental compilation is enabled

## Remarks

You must place the `data_seg` pragma between functions if you're using incremental compilation.
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/compiler-error-c2308.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Error C2308"
title: "Compiler Error C2308"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2308"
ms.date: 11/04/2016
f1_keywords: ["C2308"]
helpviewer_keywords: ["C2308"]
ms.assetid: d1eaf101-077d-4c43-97ac-410efd5b6fc9
---
# Compiler Error C2308

concatenating mismatched strings
> concatenating mismatched strings

## Remarks

Both wide and non-wide character strings were specified for concatenation. You cannot concatenate a wide character string and non-wide character string.
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-1/compiler-error-c2309.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C2309"
title: "Compiler Error C2309"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2309"
ms.date: 11/04/2016
f1_keywords: ["C2309"]
helpviewer_keywords: ["C2309"]
ms.assetid: 6303d5b5-72cf-42b8-92ce-b1eb48e80d48
---
# Compiler Error C2309

catch handler expected a parenthesized exception declaration
> catch handler expected a parenthesized exception declaration

## Remarks

A catch handler has no parenthesized type.

The following sample generates C2309:
## Example

The following example generates C2309:

```cpp
// C2309.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-1/compiler-error-c2310.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C2310"
title: "Compiler Error C2310"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2310"
ms.date: 11/04/2016
f1_keywords: ["C2310"]
helpviewer_keywords: ["C2310"]
ms.assetid: 1969c682-b97e-43fb-b9a9-f783e7ff1710
---
# Compiler Error C2310

catch handlers must specify one type
> catch handlers must specify one type

## Remarks

A catch handler specified no type or multiple types.

The following sample generates C2310:
## Example

The following example generates C2310:

```cpp
// C2310.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-1/compiler-error-c2311.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C2311"
title: "Compiler Error C2311"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2311"
ms.date: 11/04/2016
f1_keywords: ["C2311"]
helpviewer_keywords: ["C2311"]
ms.assetid: 1aff9bd5-ed0b-4db6-bbc0-01ac89850cf2
---
# Compiler Error C2311

'exception' : is caught by '...' on line number
> 'exception' : is caught by '...' on line number

## Remarks

The catch handler for the ellipsis (...) must be the last handler for a throw.

The following sample generates C2311:
## Example

The following example generates C2311:

```cpp
// C2311.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-1/compiler-error-c2312.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C2312"
title: "Compiler Error C2312"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2312"
ms.date: 11/04/2016
f1_keywords: ["C2312"]
helpviewer_keywords: ["C2312"]
ms.assetid: c8bcfd06-12c1-4323-bb53-ba392d36daa4
---
# Compiler Error C2312

'exception1' : is caught by 'exception2' on line number
> 'exception1' : is caught by 'exception2' on line number

## Remarks

Two handlers catch the same exception type.

The following sample generates C2312:
## Example

The following example generates C2312:

```cpp
// C2312.cpp
Expand Down
Loading