OSDN Git Service

PR c++/39055
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / overload / ambig1.C
1 // [over.best.ics]: For the purpose of ranking implicit conversion
2 // sequences as described in _over.ics.rank_, the ambiguous conversion
3 // sequence is treated as a user-defined sequence that is indistinguishable
4 // from any other user- defined conversion sequence.
5
6 struct A
7 {
8   A(long);
9   A(char);
10 };
11
12 struct B
13 {
14   B(int);
15 };
16
17 void f(A);                      // { dg-message "note" "candidate" }
18 void f(B);                      // { dg-message "note" "candidate" }
19
20 int main()
21 {
22   f (42);                       // { dg-error "ambiguous" "ambiguous" }
23   // { dg-message "candidate" "candidate note" { target *-*-* } 22 }
24 }