Commit bbeeb2b0 by Mark Mitchell Committed by Mark Mitchell

except.c (expand_throw): Make sure first argument to __cp_push_exception is of…

except.c (expand_throw): Make sure first argument to __cp_push_exception is of type `void*' to avoid...

	* except.c (expand_throw): Make sure first argument to
	__cp_push_exception is of type `void*' to avoid spurious error
	messages.

From-SVN: r23639
parent 93d9a2eb
1998-11-13 Mark Mitchell <mark@markmitchell.com>
* except.c (expand_throw): Make sure first argument to
__cp_push_exception is of type `void*' to avoid spurious error
messages.
1998-11-11 Jason Merrill <jason@yorick.cygnus.com> 1998-11-11 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (try_one_overload): Take orig_targs again. Only check for * pt.c (try_one_overload): Take orig_targs again. Only check for
......
...@@ -998,10 +998,7 @@ expand_throw (exp) ...@@ -998,10 +998,7 @@ expand_throw (exp)
} }
if (TREE_CODE (TREE_TYPE (exp)) == POINTER_TYPE) if (TREE_CODE (TREE_TYPE (exp)) == POINTER_TYPE)
{ throw_type = build_eh_type (exp);
throw_type = build_eh_type (exp);
exp = build_reinterpret_cast (ptr_type_node, exp);
}
else else
{ {
tree object, ptr; tree object, ptr;
...@@ -1075,6 +1072,10 @@ expand_throw (exp) ...@@ -1075,6 +1072,10 @@ expand_throw (exp)
exp = ptr; exp = ptr;
} }
/* Cast EXP to `void *' so that it will match the prototype for
__cp_push_exception. */
exp = build_reinterpret_cast (ptr_type_node, exp);
if (cleanup == NULL_TREE) if (cleanup == NULL_TREE)
{ {
cleanup = build_int_2 (0, 0); cleanup = build_int_2 (0, 0);
......
// Build don't link:
void athrow(const int & e) throw(int)
{
throw e;
}
int main(void)
{
athrow(int());
return 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