summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/overload/ambig1.C
blob: 21948bf3146cb41679945eadcb1581dd9a586e6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// [over.best.ics]: For the purpose of ranking implicit conversion
// sequences as described in _over.ics.rank_, the ambiguous conversion
// sequence is treated as a user-defined sequence that is indistinguishable
// from any other user- defined conversion sequence.

struct A
{
  A(long);
  A(char);
};

struct B
{
  B(int);
};

void f(A);			// { dg-message "note" "candidate" }
void f(B);			// { dg-message "note" "candidate" }

int main()
{
  f (42);			// { dg-error "ambiguous" "ambiguous" }
}