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:
parent
871fe673a2
commit
b7f5cbad2e
@ -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
|
||||
|
51
gcc/testsuite/g++.dg/template/pr54987.C
Normal file
51
gcc/testsuite/g++.dg/template/pr54987.C
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user