Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / g++.old-deja / g++.law / arg1.C
blob3fc42bccc1bc202fc553a7cee6e72cf6bc9f1102
1 // { dg-do assemble  }
2 // GROUPS passed arg-matching
3 // arg-matching file
4 // Subject: argument matching depending on the def order
5 // From: kondo@akane.mech.ibaraki.ac.jp
6 // Date: Fri, 04 Sep 92 17:41:05 JST
8 #include <iostream>
9 //  check the order of declarations
10 class A {
11 public:
12       void f(double* p) { std::cout << "A(double*)\n"; } // { dg-message "note" }
13       void f(int* p) { std::cout << "A(int*)\n"; } // { dg-message "note" }
16 class B {
17 public:
18       void f(int* p) { std::cout << "B(int*)\n"; } // { dg-message "note" }
19       void f(double* p) { std::cout << "B(double*)\n"; } // { dg-message "note" }
22 int main()
24     A a;
25     B b;
27     a.f(0);// { dg-error "ambiguous" }
28     // { dg-message "candidate" "candidate note" { target *-*-* } 27 }
29     b.f(0);// { dg-error "ambiguous" }
30     // { dg-message "candidate" "candidate note" { target *-*-* } 29 }