re PR c++/54987 (missed ambiguity in template function call)

2015-03-25  Paolo Carlini  <paolo.carlini@oracle.com>

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

From-SVN: r221668
This commit is contained in:
Paolo Carlini 2015-03-25 17:14:40 +00:00 committed by Paolo Carlini
parent 871fe673a2
commit b7f5cbad2e
2 changed files with 56 additions and 0 deletions

View 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

View File

@ -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;
}