Commit cb406914 by Jason Merrill Committed by Jason Merrill

re PR c++/52088 (ICE in "delete" with template convertion operator)

	PR c++/52088
	* cvt.c (build_expr_type_conversion): Check for template conversion.

From-SVN: r183940
parent 973a39ae
2012-02-06 Jason Merrill <jason@redhat.com>
PR c++/52088
* cvt.c (build_expr_type_conversion): Check for template conversion.
2012-01-31 Jason Merrill <jason@redhat.com>
PR c++/52043
......
......@@ -1539,6 +1539,17 @@ build_expr_type_conversion (int desires, tree expr, bool complain)
if (DECL_NONCONVERTING_P (cand))
continue;
if (TREE_CODE (cand) == TEMPLATE_DECL)
{
if (complain)
{
error ("ambiguous default type conversion from %qT",
basetype);
error (" candidate conversions include %qD", cand);
}
return error_mark_node;
}
candidate = non_reference (TREE_TYPE (TREE_TYPE (cand)));
switch (TREE_CODE (candidate))
......
2012-02-06 Jason Merrill <jason@redhat.com>
PR c++/52088
* g++.dg/template/conv13.C: New.
2012-02-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52115
......
// PR c++/52088
struct S
{
template <typename T>
operator T *() { return 0; }
};
int main()
{
S s;
delete s; // { dg-error "ambiguous|template|pointer" }
}
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