diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/template/unify11.C')
-rw-r--r-- | gcc/testsuite/g++.dg/template/unify11.C | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/unify11.C b/gcc/testsuite/g++.dg/template/unify11.C new file mode 100644 index 000000000..ed6b31c31 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/unify11.C @@ -0,0 +1,37 @@ +// Contributed by Dodji Seketeli <dodji@redhat.com> +// Origin: PR c++/40684 +// { dg-options "-std=c++0x" } + +struct A +{ +}; + +template <typename S, typename T, typename U, typename S::v = &S::v::s> +typename S::A +foo (S c, T t, U u) // { dg-message "note" } +{ +} + +struct B +{ + struct C + { + template <typename U> + C (U t) + { + A a; + A b = foo (this, a, t); // { dg-error "no matching function" } + // { dg-message "candidate" "candidate note" { target *-*-* } 23 } + } + } c; + B () : c (A ()) + { + } +}; + +int +main () +{ + B f; +} + |