After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769502 - making Glib::RefPtr<>::operator bool() explicit breaks comparison to zero
making Glib::RefPtr<>::operator bool() explicit breaks comparison to zero
Status: RESOLVED NOTABUG
Product: glibmm
Classification: Bindings
Component: general
2.49.x
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2016-08-04 07:46 UTC by Nils Philippsen
Modified: 2016-08-05 10:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Reproducer which exhibits the problem. (313 bytes, text/x-c++src)
2016-08-04 07:46 UTC, Nils Philippsen
Details

Description Nils Philippsen 2016-08-04 07:46:12 UTC
Created attachment 332698 [details]
Reproducer which exhibits the problem.

I've tried building Ardour (https://github.com/Ardour/ardour) from its git master branch and found that it tripped over "if (some_glib_ref_ptr == 0) ..." comparisons which worked with previous versions of glibmm (up to 2.48.x).

The attached reproducer program exhibits the issue.
Comment 1 Nils Philippsen 2016-08-05 10:22:44 UTC
NB: in the meantime, the ardour maintainer applied a workaround. The effect can be seen up to and including this commit:

https://github.com/Ardour/ardour/commit/d6fd0486aef08fcccf013d889734971ed01eaedd
Comment 2 Murray Cumming 2016-08-05 10:44:07 UTC
I think this is as intended with the switch to C++11. With C++11 you should be using nullptr instead of 0, though it's superfluous anyway. if(some_glib_ref_ptr) would be fine.

That's a very small price to pay to avoid the other implicit conversions.