aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/lookup/decl2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/lookup/decl2.C')
-rw-r--r--gcc/testsuite/g++.dg/lookup/decl2.C27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/lookup/decl2.C b/gcc/testsuite/g++.dg/lookup/decl2.C
new file mode 100644
index 00000000000..75ce0967a4b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/decl2.C
@@ -0,0 +1,27 @@
+// { dg-do compile }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Dec 2002 <nathan@codesourcery.com>
+// Source Martin Buchholz martin@xemacs.org
+
+// PR 9053. Failed to consider templates that are disambiguated by
+// return type.
+
+template <typename T> class bar;
+template <> struct bar<const char*> { typedef void type; };
+template <typename T> class qux;
+template <> struct qux<int> { typedef void type; };
+
+template <typename T>
+typename bar<T>::type foo (T t) { }
+
+template <typename T>
+typename qux<T>::type foo (T t) { }
+
+
+int
+main (int argc, char *argv[])
+{
+ foo ("foo");
+ foo (7);
+}