Commit 6b6b60af by Mark Mitchell Committed by Mark Mitchell

re PR c++/24671 (ICE with zero-sized arrays)

	PR c++/24671
	* pt.c (instantiate_template): Handle SFINAE.
	PR c++/24671
	* g++.dg/template/sfinae3.C: New test.

From-SVN: r109022
parent 59e7c84c
2005-12-23 Mark Mitchell <mark@codesourcery.com>
PR c++/24671
* pt.c (instantiate_template): Handle SFINAE.
2005-12-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2005-12-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* decl.c (grokdeclarator): Improve diagnostic for friend * decl.c (grokdeclarator): Improve diagnostic for friend
......
...@@ -9149,6 +9149,8 @@ instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain) ...@@ -9149,6 +9149,8 @@ instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain)
/* Substitute template parameters. */ /* Substitute template parameters. */
fndecl = tsubst (DECL_TEMPLATE_RESULT (gen_tmpl), fndecl = tsubst (DECL_TEMPLATE_RESULT (gen_tmpl),
targ_ptr, complain, gen_tmpl); targ_ptr, complain, gen_tmpl);
if (fndecl == error_mark_node)
return error_mark_node;
/* Now we know the specialization, compute access previously /* Now we know the specialization, compute access previously
deferred. */ deferred. */
......
2005-12-23 Mark Mitchell <mark@codesourcery.com>
PR c++/24671
* g++.dg/template/sfinae3.C: New test.
2005-12-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2005-12-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* g++.dg/other/friend4.C: New test. * g++.dg/other/friend4.C: New test.
// PR c++/24671
// { dg-options "" }
template<typename> struct A
{
typedef int X;
static const int i = 0;
};
template<typename> struct B
{
B(const B&); // { dg-error "candidate" }
typedef typename A<char[A<B>::i]>::X Y;
template<typename T> B(T, Y); // { dg-error "call" }
};
B<int> b(0,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