Commit fb80065c by Paolo Carlini

re PR c++/44628 (ICE in cp_build_unary_op at cp/typeck.c:4671)

/cp
2010-06-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/44628
	* typeck.c (cp_build_unary_op): Early return error_mark_node when
	arg is NULL_TREE too.
	* call.c (convert_class_to_reference): Return error_mark_node when
	expr is NULL_TREE.

/testsuite
2010-06-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/44628
	* g++.dg/template/crash100.C: New.

From-SVN: r161639
parent a87cf97e
2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/44628
* typeck.c (cp_build_unary_op): Early return error_mark_node when
arg is NULL_TREE too.
* call.c (convert_class_to_reference): Return error_mark_node when
expr is NULL_TREE.
2010-06-30 Michael Matz <matz@suse.de> 2010-06-30 Michael Matz <matz@suse.de>
* repo.c ((finish_repo): Fix typo. * repo.c (finish_repo): Fix typo.
2010-06-30 Nathan Froyd <froydnj@codesourcery.com> 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
...@@ -17,7 +25,7 @@ ...@@ -17,7 +25,7 @@
* tree.c: Include gimple.h. Do not include tree-flow.h * tree.c: Include gimple.h. Do not include tree-flow.h
* decl.c: Do not include tree-flow.h * decl.c: Do not include tree-flow.h
* Make-lang.in: Adjust dependencies. * Make-lang.in: Adjust dependencies.
2010-06-29 Nathan Froyd <froydnj@codesourcery.com> 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
* decl.c (incomplete_var): Declare. Declare VECs containing them. * decl.c (incomplete_var): Declare. Declare VECs containing them.
......
...@@ -1040,6 +1040,9 @@ convert_class_to_reference (tree reference_type, tree s, tree expr, int flags) ...@@ -1040,6 +1040,9 @@ convert_class_to_reference (tree reference_type, tree s, tree expr, int flags)
struct z_candidate *cand; struct z_candidate *cand;
bool any_viable_p; bool any_viable_p;
if (!expr)
return NULL;
conversions = lookup_conversions (s, /*lookup_template_convs_p=*/true); conversions = lookup_conversions (s, /*lookup_template_convs_p=*/true);
if (!conversions) if (!conversions)
return NULL; return NULL;
......
...@@ -4781,7 +4781,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert, ...@@ -4781,7 +4781,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
tree val; tree val;
const char *invalid_op_diag; const char *invalid_op_diag;
if (error_operand_p (arg)) if (!arg || error_operand_p (arg))
return error_mark_node; return error_mark_node;
if ((invalid_op_diag if ((invalid_op_diag
......
2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/44628
* g++.dg/template/crash100.C: New.
2010-06-30 Jan Hubicka <jh@suse.cz> 2010-06-30 Jan Hubicka <jh@suse.cz>
* gcc.dg/tree-ssa/ipa-split-4.c: New testcase. * gcc.dg/tree-ssa/ipa-split-4.c: New testcase.
......
// PR c++/44628
template <typename T>
class Temp
{
int Val;
public:
operator T&(void) { return Val; }
virtual T& operator=(T a ) // { dg-error "overriding" }
{
Val = a;
return Val;
}
};
class Int : public Temp<int>
{
public:
Int& operator=(int a) // { dg-error "conflicting return type" }
{
return (*this);
}
};
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