Opened 8 years ago

Closed 3 years ago

#11107 closed Tasks (fixed)

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 8 years ago.
virtual destructor error log

Download all attachments as: .zip

Change History (9)

comment:1 by Jürgen Hunold, 8 years ago

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 by Raffi Enficiaud, 8 years ago

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 by Raffi Enficiaud, 8 years ago

Owner: changed from Gennadiy Rozental to Raffi Enficiaud

comment:4 by Raffi Enficiaud, 8 years ago

Status: newassigned

by Jürgen Hunold, 8 years ago

Attachment: virtual.zip added

virtual destructor error log

comment:5 by Jürgen Hunold, 8 years ago

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

comment:6 by Raffi Enficiaud, 8 years ago

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 by Raffi Enficiaud, 5 years ago

Milestone: To Be DeterminedBoost 1.65.0

comment:8 by Raffi Enficiaud, 3 years ago

Resolution: fixed
Status: assignedclosed

Addressed by rev 13ca3e07f071ee36a0c5be5c6a0b58be7ab4637c

Note: See TracTickets for help on using tickets.