Commit b7f5cbad by Paolo Carlini Committed by Paolo Carlini

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
parent 871fe673
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> 2015-03-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/62630 PR tree-optimization/62630
......
// 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment