summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/unify11.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/template/unify11.C')
-rw-r--r--gcc/testsuite/g++.dg/template/unify11.C36
1 files changed, 36 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 00000000000..c8df94b31ca
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/unify11.C
@@ -0,0 +1,36 @@
+// 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)
+{
+}
+
+struct B
+{
+ struct C
+ {
+ template <typename U>
+ C (U t)
+ {
+ A a;
+ A b = foo (this, a, t); // { dg-error "no matching function" }
+ }
+ } c;
+ B () : c (A ())
+ {
+ }
+};
+
+int
+main ()
+{
+ B f;
+}
+