summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/explicit-args1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/template/explicit-args1.C')
-rw-r--r--gcc/testsuite/g++.dg/template/explicit-args1.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/explicit-args1.C b/gcc/testsuite/g++.dg/template/explicit-args1.C
new file mode 100644
index 000000000..10d59e157
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/explicit-args1.C
@@ -0,0 +1,21 @@
+// PR c++/34950
+
+template <class T = int> struct policy {
+ typedef int unnecessary;
+};
+
+template <class Policy> struct A {
+ typedef int type;
+ typedef typename Policy::unnecessary unused;
+};
+
+template <class T> struct S {
+ typedef int type;
+ typedef typename A<T>::type unused;
+};
+
+template <class, class T> typename S<T>::type foo();
+template <class> S<policy<> >::type foo();
+
+template <typename T> int def(T);
+const int i = def(foo<int>);