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 568074 - class PaperSize contains multiple default constructors
class PaperSize contains multiple default constructors
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
2.14.x
Other All
: Normal minor
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2009-01-17 12:50 UTC by Tao Wang
Modified: 2009-01-19 11:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tao Wang 2009-01-17 12:50:17 UTC
Please describe the problem:
PaperSize contains 2 default constructors.

In papersize.hg, there is only one default constructors:

  papersize.hg line 55:  explicit PaperSize(const Glib::ustring& name = "");

However, in the generated papersize.h, there is one more default constrctor:

  papersize.h line 102:   PaperSize();

This cause warning C4520 in Visual Studio 2008:

  c:\program files\gtkmm\include\gtkmm-2.4\gtkmm\papersize.h(265) : warning C4520: 'Gtk::PaperSize' : multiple default constructors specified

The problem could be fixed by remove the default value in papersize.hg:

Index: gtk/src/papersize.hg
===================================================================
--- gtk/src/papersize.hg	(revision 1072)
+++ gtk/src/papersize.hg	(working copy)
@@ -52,7 +52,7 @@
   // Allowing no argument works because gtk_paper_size_new() will call
   // gtk_paper_size_get_default() in case of NULL.
   /// If a name is not specified, a default value will be used.
-  explicit PaperSize(const Glib::ustring& name = "");
+  explicit PaperSize(const Glib::ustring& name);
   explicit PaperSize(const Glib::ustring& ppd_name, const Glib::ustring& ppd_display_name, double width, double height);
   explicit PaperSize(const Glib::ustring& name, const Glib::ustring& display_name, double width, double height, Unit unit);
 




Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Murray Cumming 2009-01-19 11:47:38 UTC
Thanks. Fixed in svn trunk.

Note that the default constructor does something very different. get_default() is the actual equivalent of name="" with that constructor.