Page MenuHomePhabricator

Clang build error in QmitkServiceListWidget
Closed, ResolvedPublic

Description

Building the current master with the Clang compiler gives a build error in the QmitkServiceListWidget:

/Volumes/Macintosh_HD_2/projects/mitk/Bugsquashing/MITK/Modules/Qmitk/./QmitkServiceListWidget.h:116:102: error: non-const lvalue reference to type 'std::string'

  (aka 'basic_string<char>') cannot bind to a temporary of type 'std::string'
void Initialize(const std::string& namingProperty = static_cast< std::string >(""), std::string& filter = static_cast< std::string >(""))
                                                                                                 ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

There simply the const declaration for the lvalue is missing which is need when binding a temporary to a reference.

Event Timeline

Branch is bug-13053-clang-build-error-in-ServiceListWidget

[2b0954]: Merge branch 'bug-13053-clang-build-error-in-ServiceListWidget'

Merged commits:

2012-09-06 17:43:46 Andreas Fetzer [14fe99]
Added const to lvalue reference since binding temporary objects
to non-const references has been disallowed.