1 // Contributed by Dodji Seketeli <dodji@redhat.com>
2 // Origin: PR c++/40684
3 // { dg-do compile { target c++11 } }
4 
5 struct A
6 {
7 };
8 
9 template <typename S, typename T, typename U,
10 	  typename S::v = &S::v::s> // { dg-error "is not a" }
11 typename S::A
foo(S c,T t,U u)12 foo (S c, T t, U u)
13 {
14 }
15 
16 struct B
17 {
18   struct C
19   {
20     template <typename U>
CB::C21     C (U t)
22     {
23       A a;
24       A b = foo (this, a, t); // { dg-error "no matching function" }
25     }
26   } c;
BB27   B () : c (A ())
28   {
29   }
30 };
31 
32 int
main()33 main ()
34 {
35   B f;
36 }
37 
38