Skip to content

Repo sync for protected CLA branch #4250

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 4 commits into from
Oct 28, 2022
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
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
description: "Learn more about: Compiler Warning (level 4) C4623"
title: "Compiler Warning (level 4) C4623"
ms.date: "11/04/2016"
ms.date: 10/27/2022
f1_keywords: ["C4623"]
helpviewer_keywords: ["C4623"]
ms.assetid: e630d8d0-f6ea-469c-a74f-07b027587225
---
# Compiler Warning (level 4) C4623

'`derived class`' : default constructor was implicitly defined as deleted because a base class default constructor is inaccessible or deleted
> '`derived class`' : default constructor was implicitly defined as deleted

A constructor was not accessible in a base class and was not generated for the derived class. Any attempt to create an object of this type on the stack will cause a compiler error.
Because the default constructor is deleted or inaccessible in a base class, the compiler can't generate a default constructor for the derived class. Attempts to create an object of this type by using the default constructor (for example, in an array) cause a compiler error.

This warning is off by default. See [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md) for more information.
This warning is off by default. For more information, see [Compiler warnings that are off by default](../../preprocessor/compiler-warnings-that-are-off-by-default.md).

## Example

Expand All @@ -35,6 +35,6 @@ class D : public B {}; // C4623 - to fix, make B's constructor public
class E : public C {}; // OK - class C constructor is public

int main() {
// D d; will cause an error
// D d; // Error C2280
}
```