Skip to content
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

Fix: activate virtual destructors for all msvc versions #41

Closed
wants to merge 1 commit into from
Closed

Fix: activate virtual destructors for all msvc versions #41

wants to merge 1 commit into from

Conversation

jhunold
Copy link
Contributor

@jhunold jhunold commented Mar 8, 2015

All msvc version spew out warnings so make the destructors virtual for all.

@rogeeff
Copy link
Contributor

rogeeff commented Mar 8, 2015

Why do we need this?

On Sun, Mar 8, 2015 at 12:45 PM, Jürgen Hunold notifications@github.com
wrote:

All msvc version spew out warnings so make the destructors virtual for all.

You can view, comment on, or merge this pull request online at:

#41
Commit Summary

  • Fix: activate virtual destructors for all msvc versions

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#41.

Gennadiy Rozental

@jhunold
Copy link
Contributor Author

jhunold commented Mar 9, 2015

msvc will issue warnings about the destructors being not virtual. There is no need to make this dependent on the compiler version as all version complain.

Another solution would be to disable this via #pragma . Or just make the destructor virtual by default, as gcc and clang are already doing this.

@rogeeff
Copy link
Contributor

rogeeff commented Mar 11, 2015

Can we file a bug report with MSVC compiler?

On Mon, Mar 9, 2015 at 4:33 AM, Jürgen Hunold notifications@github.com
wrote:

msvc will issue warnings about the destructors being not virtual. There is
no need to make this dependent on the compiler version as all version
complain.

Another solution would be to disable this via #pragma . Or just make the
destructor virtual by default, as gcc and clang are already doing this.


Reply to this email directly or view it on GitHub
#41 (comment).

Gennadiy Rozental

@raffienficiaud
Copy link
Member

FYI, I created the ticket https://svn.boost.org/trac/boost/ticket/11107. It looks to me that non-virtual is a bug, but I do not understand the first intention of this workaround. Any hint? (some more details in the ticket)

@rogeeff
Copy link
Contributor

rogeeff commented Mar 12, 2015

destructor of base class should be either virtual or protected. I chose
second option and its perfectly valid option - no need for any warnings

On Wed, Mar 11, 2015 at 6:19 PM, Raffi Enficiaud notifications@github.com
wrote:

FYI, I created the ticket https://svn.boost.org/trac/boost/ticket/11107.
It looks to me that non-virtual is a bug, but I do not understand the first
intention of this workaround. Any hint? (some more details in the ticket)


Reply to this email directly or view it on GitHub
#41 (comment).

Gennadiy Rozental

@raffienficiaud
Copy link
Member

You're right. However, protected + virtual does not harm neither? On the other hand, I cannot see any warning with b2 --with-test. @jhunold would you please attach the logs to the ticket please? We would then better understand what we are discussing.

@jhunold
Copy link
Contributor Author

jhunold commented Mar 12, 2015

Right, added full log to the ticket. I've just made the warning an error to just clarify things. @rogeeff All major compilers warn about this (gcc,clang and msvc) so I doubt they are all wrong. I've only found
http://www.gotw.ca/publications/mill18.htm stating:

Guideline #4: A base class destructor should be either public and virtual, or protected and nonvirtual.

True, the standard library itself does not always follow these design criteria. In part, that's a reflection of how we as a community have learned over the years.

So that is a guideline from 14 years ago. I*d really like to know if this is still valid or the exact paragraph of the standard handling this.

@raffienficiaud
Copy link
Member

Hi,

Would you please try the develop branch again for this warning? The log you sent were not on the protected part, see commit 653aae5

@jhunold
Copy link
Contributor Author

jhunold commented Mar 18, 2015

Uploaded a new log to the ticket. I had the patch active when doing the test run. I really should create the working branch before committing.

@raffienficiaud
Copy link
Member

Superseded/addressed by 13ca3e0

@raffienficiaud raffienficiaud added this to the 1.73 milestone Dec 15, 2019
@raffienficiaud raffienficiaud self-assigned this Dec 15, 2019
@raffienficiaud
Copy link
Member

Merged to master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants