Skip to content

Repo sync for protected branch #5030

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

Merged
merged 6 commits into from
Apr 29, 2024
Merged
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
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-warnings/c5243.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Compiler Warning C5243"
title: Compiler warning C5243
description: Compiler warning C5243 description and solution.
ms.date: 08/09/2021
f1_keywords: ["C5243"]
Expand All @@ -11,7 +11,7 @@ helpviewer_keywords: ["C5243"]

## Remarks

The Microsoft C++ ABI in Visual Studio 2019 and earlier versions uses more than one kind of pointer-to-member type. These types have different sizes that depend on the inheritance model used by the class. The C++ standard allows you to declare a pointer-to-member of an incomplete class type. If you declare a variable of pointer-to-member type for an incomplete class, the compiler must use the most general representation. It can lead to a *one definition rule*, or ODR violation, since the compiler may use a smaller, more specific representation for this pointer-to-member type in other translation units where the complete class type is available.
The Microsoft C++ ABI uses more than one kind of pointer-to-member type. These types have different sizes that depend on the inheritance model used by the class. The C++ standard allows you to declare a pointer-to-member of an incomplete class type. If you declare a variable of pointer-to-member type for an incomplete class, the compiler must use the most general representation. It can lead to a *one definition rule*, or ODR violation, since the compiler may use a smaller, more specific representation for this pointer-to-member type in other translation units where the complete class type is available.

To resolve this error, you can specify the complete class type before you declare the pointer-to-member variable. Or, use a Microsoft-specific [inheritance keyword](../../cpp/inheritance-keywords.md) to specify the correct inheritance model on the incomplete forward class declaration.

Expand Down