From b7f5cbad2eee68fb861f44f7cdbd93ae1c7c8121 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 25 Mar 2015 17:14:40 +0000 Subject: [PATCH] re PR c++/54987 (missed ambiguity in template function call) 2015-03-25 Paolo Carlini PR c++/54987 * g++.dg/template/pr54987.C: New. From-SVN: r221668 --- gcc/testsuite/ChangeLog | 5 +++ gcc/testsuite/g++.dg/template/pr54987.C | 51 +++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 gcc/testsuite/g++.dg/template/pr54987.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b6dfe3b3a52..7dedff41e2d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-25 Paolo Carlini + + PR c++/54987 + * g++.dg/template/pr54987.C: New. + 2015-03-25 Richard Biener 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 index 00000000000..773f023e0a4 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/pr54987.C @@ -0,0 +1,51 @@ +// PR c++/54987 + +struct Argument1 +{ +}; + +struct Argument2 +{ +}; + +template +struct Template1 +{ + Template1() {} + + template + Template1( const Template1& ) {} +}; + +template +struct Template2 +{ + Template2() {} + + template + Template2( const Template1& ) {} +}; + +template +struct make_type +{ + typedef Argument1 type; +}; + +template +void foo( T, Template1::type> ) +{ +} + +template +void foo( T, Template2::type> ) +{ +} + +int main() +{ + Template1 t; + Argument1 a; + foo( a, t ); // { dg-error "ambiguous" } + return 0; +} -- 2.30.2