Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8927071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:08:16+00:00 2026-06-15T08:08:16+00:00

The following code will cause C4624 . But you can see D is not

  • 0

The following code will cause C4624. But you can see D is not the sub class of B. Why still got this warning? Thanks!

class B {
// Uncomment the following line to resolve.
// public:
~B();
};

class D  {B b;};   // C4624 B's destructor not public

More details about the warning:

C4624: ‘derived class’ : destructor could not be generated because a base class destructor is inaccessible

A destructor was not accessible in a base class and was therefore not generated for a derived class. Any attempt to create an object of this type on the stack will cause a compiler error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T08:08:17+00:00Added an answer on June 15, 2026 at 8:08 am

    Class members are initialised by the class’s constructor(s) and destroyed by its destructor. Their constructor(s) and destructor must therefore be accessible within those functions.

    In your example, B has a private destructor, and is therefore not accessible to the destructor of D, which needs it to destroy its member of type B.

    I’ve no idea why the error message refers to a “base class” though. If you get that error message from the code you posted, then your compiler could do with some improvements to its diagnostics.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Will the following code cause a ConcurrentModificationException or other side effects? ArrayList<String> newList =
The following code will search for the user within the domain controller, but I
Hi can someone explain if the in the following code the synchronized code will
Since when did: //echo [$sql][$result][$rows][$e]<BR>; cause an error? The code following this comment gets
The following code will cause compile errors in g++4.4: // File test.cpp namespace A
The following code works fine under Cassini, but not at all under IIS. I
I was wondering, why the following way of code (Already commented out) will cause
Will the following code cause race condition issue if several threads invoke the incrementCount
The following code will add the categories selector widget to the WordPress Page editor
The following code will log in my application to a server. That server will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.