Opened 4 years ago

Last modified 15 months ago

#11107 assigned Tasks

A lot of warnings on MSVC due to protected destructor being non-virtual

Reported by: Raffi Enficiaud Owned by: Raffi Enficiaud
Milestone: Boost 1.65.0 Component: test
Version: Boost 1.57.0 Severity: Cosmetic
Keywords: MSVC warnings Cc:

Description

See pull-request https://github.com/boostorg/test/pull/41

The fact that the destructor is non virtual looks like a bug to me. This was introduced in 2005, rev ef3fe4a826ebc31afbbb4c781dd3d9e504f360f1, with a commit log message "dll support introduced". It sounds like it has connection with the visibility of the destructors across dll/so boundaries, maybe for some broken compiler.

I am in favor of removing this workaround.

Attachments (1)

virtual.zip (9.5 KB) - added by Jürgen Hunold 4 years ago.
virtual destructor error log

Download all attachments as: .zip

Change History (8)

comment:1 Changed 4 years ago by Jürgen Hunold

Full log "virtual.zip" attached. Commandline:

..\..\..\b2 -a cxxflags=-we4265 -j3 2>&1 | "C:\Program Files (x86)\git\bin\tee.exe" virtual.log

See https://msdn.microsoft.com/en-us/library/wzxffy8c.aspx for the official description. We normally make this a level 3 warning, I've changed this to an error to get clearer test result.

comment:2 Changed 4 years ago by Raffi Enficiaud

Thanks. So I'm not addressing the trillion of warnings from error_info_container in boost.exception.

The warning for collection is indeed a true one, good catch! I am adding a virtual destructor to class dataset, which should solve most of the issues in your log.

However, this has nothing to do with the pull request in fact (and Gennadiy was right). The macro that gets activated with your change does not solve the problem I can see in this log.

comment:3 Changed 4 years ago by Raffi Enficiaud

Owner: changed from Gennadiy Rozental to Raffi Enficiaud

comment:4 Changed 4 years ago by Raffi Enficiaud

Status: newassigned

Changed 4 years ago by Jürgen Hunold

Attachment: virtual.zip added

virtual destructor error log

comment:5 Changed 4 years ago by Jürgen Hunold

Sorry, I had the patch still active when doing the first run. Uploaded the correct run.

comment:6 Changed 4 years ago by Raffi Enficiaud

A quick look at this tells me that most of the warnings can be safely ignored: in fact most of the instances are not meant to be used on the heap, but rather on the stack.

I will have a deeper look tonight/tomorrow.

comment:7 Changed 15 months ago by Raffi Enficiaud

Milestone: To Be DeterminedBoost 1.65.0
Note: See TracTickets for help on using tickets.