re PR c++/54987 (missed ambiguity in template function call)
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 25 Mar 2015 17:14:40 +0000 (17:14 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 25 Mar 2015 17:14:40 +0000 (17:14 +0000)
2015-03-25  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/54987
* g++.dg/template/pr54987.C: New.

From-SVN: r221668

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/pr54987.C [new file with mode: 0644]

index b6dfe3b3a5271b3250218d117c2eb21bc10ca3ae..7dedff41e2d41ff7d443fd425fc16187631dc099 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-25  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/54987
+       * g++.dg/template/pr54987.C: New.
+
 2015-03-25  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/62630
diff --git a/gcc/testsuite/g++.dg/template/pr54987.C b/gcc/testsuite/g++.dg/template/pr54987.C
new file mode 100644 (file)
index 0000000..773f023
--- /dev/null
@@ -0,0 +1,51 @@
+// PR c++/54987
+
+struct Argument1
+{
+};
+
+struct Argument2
+{
+};
+
+template<typename T>
+struct Template1
+{
+  Template1() {}
+
+  template<typename Y>
+  Template1( const Template1<Y>& ) {}
+};
+
+template<typename T>
+struct Template2
+{
+  Template2() {}
+
+  template<typename Y>
+  Template2( const Template1<Y>& ) {}
+};
+
+template <typename T>
+struct make_type
+{
+  typedef Argument1 type;
+};
+
+template<typename T>
+void foo( T, Template1<typename make_type<T>::type> )
+{
+}
+
+template<typename T>
+void foo( T, Template2<typename make_type<T>::type> )
+{
+}
+
+int main()
+{
+  Template1<Argument2> t;
+  Argument1 a;
+  foo( a, t );  // { dg-error "ambiguous" }
+  return 0;
+}