Commit 3cb9d1d5 by Paolo Carlini Committed by Paolo Carlini

re PR c++/42055 (ICE with ambiguous template specialization)

cp/
2009-11-16  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/42055
	* pt.c (determine_specialization): Assign to candidates the return
	value of the chainon called before print_candidates.

testsuite/
2009-11-16  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/42055
	* testsuite/g++.dg/template/crash92.C: New.

From-SVN: r154202
parent 0e3776db
2009-11-16 Paolo Carlini <paolo.carlini@oracle.com> 2009-11-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/42055
* pt.c (determine_specialization): Assign to candidates the return
value of the chainon called before print_candidates.
2009-11-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/32056 PR c++/32056
* decl.h (enum decl_context): Add TPARM enumerator. * decl.h (enum decl_context): Add TPARM enumerator.
* decl.c (grokdeclarator): Per 14.1/2, error out if a storage class * decl.c (grokdeclarator): Per 14.1/2, error out if a storage class
......
...@@ -1941,7 +1941,7 @@ determine_specialization (tree template_id, ...@@ -1941,7 +1941,7 @@ determine_specialization (tree template_id,
{ {
error ("ambiguous template specialization %qD for %q+D", error ("ambiguous template specialization %qD for %q+D",
template_id, decl); template_id, decl);
chainon (candidates, templates); candidates = chainon (candidates, templates);
print_candidates (candidates); print_candidates (candidates);
return error_mark_node; return error_mark_node;
} }
......
2009-11-16 Paolo Carlini <paolo.carlini@oracle.com> 2009-11-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/42055
* testsuite/g++.dg/template/crash92.C: New.
2009-11-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/32056 PR c++/32056
* testsuite/g++.dg/template/error44.C: New. * testsuite/g++.dg/template/error44.C: New.
......
// PR c++/42055
template<typename T> void foo(T, T); // { dg-error "candidates|template" }
template<typename T> void foo(T, int); // { dg-error "template" }
template void foo(int, int); // { dg-error "ambiguous template specialization" }
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