Commit 79b59cc3 by Mark Mitchell Committed by Mark Mitchell

re PR c++/10635 (ICE (segfault) when dereferencing an incomplete type casted from a void pointer)

	PR c++/10635
	* typeck.c (build_c_cast): Check that the destination type is
	complete.

	PR c++/10635
	* g++.dg/expr/cast1.C: New test.

[[Split portion of a mixed commit.]]

From-SVN: r67840.2
parent 54da776f
2003-06-12 Mark Mitchell <mark@codesourcery.com>
PR c++/10635
* typeck.c (build_c_cast): Check that the destination type is
complete.
2003-06-11 Mark Mitchell <mark@codesourcery.com>
PR c++/10432
......
......@@ -5189,6 +5189,10 @@ build_c_cast (type, expr)
value = convert_to_void (value, /*implicit=*/NULL);
return value;
}
if (!complete_type_or_else (type, NULL_TREE))
return error_mark_node;
/* Convert functions and arrays to pointers and
convert references to their expanded types,
but don't convert any other types. If, however, we are
......
2003-06-12 Mark Mitchell <mark@codesourcery.com>
PR c++/10635
* g++.dg/expr/cast1.C: New test.
2003-06-12 Roger Sayle <roger@eyesopen.com>
* gcc.dg/builtins-21.c: New test case.
......
struct S; // { dg-error "forward" }
void f(S* p) { ((S) (*p)); } // { dg-error "" }
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