OSDN Git Service

gcc/cp/
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.pt / spec35.C
1 // { dg-do assemble  }
2 // 
3 // Copyright (C) 2000 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 18 Jan 2001 <nathan@codesourcery.com>
5
6 // Bug 1617. We didn't resolve partial ordering properly. The std is rather
7 // vague about it anyway, DR 214 talks about this.
8
9 extern "C" int puts (char const *);
10
11 template <typename T> int Foo (T);    // { dg-message "note" } 
12 template <typename T> int Foo (T &);  // { dg-message "note" } candidate
13
14 template <typename T> int Qux (T);    // { dg-message "note" } 
15 template <typename T> int Qux (T const &);  // { dg-message "note" } candidate
16
17 template <typename T> int Bar (T const *const &); // { dg-message "note" } 
18 template <typename T> int Bar (T *const &);       // { dg-message "note" } candidate
19 template <typename T> int Bar (T *);              // { dg-message "note" } candidate
20
21 template <typename T> int Baz (T *const &);       // { dg-message "note" } 
22 template <typename T> int Baz (T *);              // { dg-message "note" } candidate
23
24 int Baz (int const *ptr, int *ptr2)
25 {
26   Baz (ptr2);   // { dg-error "ambiguous" } 
27   // { dg-message "candidate" "candidate note" { target *-*-* } 26 }
28   Bar (ptr2);   // { dg-error "ambiguous" } 
29   // { dg-message "candidate" "candidate note" { target *-*-* } 28 }
30   Foo (ptr2);   // { dg-error "ambiguous" } 
31   // { dg-message "candidate" "candidate note" { target *-*-* } 30 }
32   Qux (ptr2);   // { dg-error "ambiguous" } 
33   // { dg-message "candidate" "candidate note" { target *-*-* } 32 }
34   return 0;
35 }