OSDN Git Service

2011-02-20 Paolo Carlini <paolo.carlini@oracle.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / unify11.C
1 // Contributed by Dodji Seketeli <dodji@redhat.com>
2 // Origin: PR c++/40684
3 // { dg-options "-std=c++0x" }
4
5 struct A
6 {
7 };
8
9 template <typename S, typename T, typename U, typename S::v = &S::v::s>
10 typename S::A
11 foo (S c, T t, U u)             // { dg-message "note" }
12 {
13 }
14
15 struct B
16 {
17   struct C
18   {
19     template <typename U>
20     C (U t)
21     {
22       A a;
23       A b = foo (this, a, t); // { dg-error "no matching function" }
24       // { dg-message "candidate" "candidate note" { target *-*-* } 23 }
25     }
26   } c;
27   B () : c (A ())
28   {
29   }
30 };
31
32 int
33 main ()
34 {
35   B f;
36 }
37