On Wed, 8 Aug 2012, Richard Guenther wrote:

+  static double_int make (unsigned HOST_WIDE_INT cst);
+  static double_int make (HOST_WIDE_INT cst);
+  static double_int make (unsigned int cst);
+  static double_int make (int cst);
[...]
Btw, if HOST_WIDE_INT == int the above won't even compile.

Is that true of any host?  I am not aware of any.  Anyway, it is
moot if we remove the overloads.

Right.  I'd simply rely on int / unsigned int promotion to HOST_WIDE_INT
or unsigned HOST_WIDE_INT and only provide overloads for HOST_WIDE_INT
kinds anyway.

Sadly, that doesn't work with the current C++ rules (there is a proposal to change that for C++1y):

void f(long);
void f(unsigned long);
void g(int x){f(x);}

e.cc: In function ‘void g(int)’:
e.cc:3:18: error: call of overloaded ‘f(int&)’ is ambiguous
e.cc:3:18: note: candidates are:
e.cc:1:6: note: void f(long int)
e.cc:2:6: note: void f(long unsigned int)

--
Marc Glisse

Reply via email to