Ticket #9085 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Fix disallowed implicit casts to bool

Reported by: Peter Parker Owned by: Peter Parker
Priority: trivial Milestone: Release 3.2
Component: SANS Keywords:
Cc: Blocked By:
Blocking: Tester: Nick Draper

Description

A recent Fedora 20 build highlighted a problem we've come across before, which is that Boost have changed the bool operator for their smart pointers to include the explicit keyword.

This manifested itself in the following error message:

08:46:23 /home/builder/jenkins/workspace/ornl_fedora20_master/Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp: In member function ‘void MantidQt::CustomInterfaces::SANSRunWindow::setGeometryDetails()’:
08:46:23 /home/builder/jenkins/workspace/ornl_fedora20_master/Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp:1443:78: error: cannot convert ‘boost::shared_ptr<const Mantid::API::WorkspaceGroup>’ to ‘const bool’ in initialization
08:46:23    const bool isGroupWs = boost::dynamic_pointer_cast<const WorkspaceGroup>(ws);
08:46:23                                                                               ^
08:46:23 /home/builder/jenkins/workspace/ornl_fedora20_master/Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp:1449:79: error: cannot convert ‘boost::shared_ptr<const Mantid::API::IEventWorkspace>’ to ‘const bool’ in initialization
08:46:23    const bool isEventWs = boost::dynamic_pointer_cast<const IEventWorkspace>(ws);

This occurred in work already merged into master, so I'm opening another ticket here to fix the bug.

Change History

comment:1 Changed 7 years ago by Owen Arnold

  • Status changed from new to assigned

Should be relatively easy to fix given the usage example.

comment:2 Changed 7 years ago by Peter Parker

  • Status changed from assigned to inprogress

Refs #9085 - Fix errors for more recent versions of Boost.

Changeset: 4301d2dbd3430bad3ca6c7d069cf457e8fc8a08c

comment:3 Changed 7 years ago by Peter Parker

  • Status changed from inprogress to verify
  • Resolution set to fixed

Tester:

A code review and a check that the SNS Fedora 20 build now shows no sign of the errors above should be enough. If you really want to you can load one of the System Test SANS2D data files into the SANS ISIS interface and then check that the Geometry tab has been populated under the "Sample" heading.

comment:4 Changed 7 years ago by Jay Rainey

  • Status changed from verify to verifying
  • Tester set to Jay Rainey

comment:5 Changed 7 years ago by Jay Rainey

  • Status changed from verifying to reopened
  • Resolution fixed deleted

comment:6 Changed 7 years ago by Peter Parker

Somebody on Fedora 20 should test.

Last edited 7 years ago by Peter Parker (previous) (diff)

comment:7 Changed 7 years ago by Peter Parker

  • Status changed from reopened to verify
  • Resolution set to fixed

comment:8 Changed 7 years ago by Nick Draper

  • Status changed from verify to verifying
  • Tester changed from Jay Rainey to Nick Draper

comment:9 Changed 7 years ago by Nick Draper

Tested by code review as it is very simple.

comment:10 Changed 7 years ago by Nick Draper

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/bugfix/9085_fix_disallowed_implicit_casts_to_bool'

Full changeset: f1aed905accdb74bcbe9eef3ef56c15aee37d6b0

comment:11 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9928

Note: See TracTickets for help on using tickets.