+2001-03-02 Nathan Sidwell <nathan@codesourcery.com>
+
+ * call.c (joust): cp_pedwarn when using gnu extension concerning
+ worst conversion sequences.
+
2001-03-01 Zack Weinberg <zackw@stanford.edu>
* decl.c: Replace all uses of 'boolean' with 'bool'.
if (!pedantic)
{
int rank1 = IDENTITY_RANK, rank2 = IDENTITY_RANK;
+ struct z_candidate *w, *l;
for (i = 0; i < len; ++i)
{
if (ICS_RANK (TREE_VEC_ELT (cand2->convs, i+off2)) > rank2)
rank2 = ICS_RANK (TREE_VEC_ELT (cand2->convs, i+off2));
}
-
if (rank1 < rank2)
- return 1;
+ winner = 1, w = cand1, l = cand2;
if (rank1 > rank2)
- return -1;
+ winner = -1, w = cand2, l = cand1;
+ if (winner)
+ {
+ if (warn)
+ {
+ cp_pedwarn ("choosing `%D' over `%D'", w->fn, l->fn);
+ cp_pedwarn (
+" because worst conversion for the former is better than worst conversion for the latter");
+ }
+ else
+ add_warning (w, l);
+ return winner;
+ }
}
my_friendly_assert (!winner, 20010121);
+2001-03-02 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.ext/overload1.C: New test.
+
2001-03-01 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.pt/using1.C: New test.
--- /dev/null
+// Build don't link:
+// Special g++ Options: -fpermissive
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 28 Feb 2001 <nathan@codesourcery.com>
+
+// Make sure we warn about our overload extension about picking the
+// one with the least worse conversion
+
+struct X
+{
+ X (int);
+};
+void Foo (int, float, bool);
+void Foo (float, int, X);
+
+void Baz ()
+{
+ Foo (1, 1, 0); // WARNING - least worse
+}