Commit 662c2e83 by Lee Millward Committed by Lee Millward

re PR c++/28292 (ICE in acceptable_java_type)

	PR c++/28292
	* decl2.c (acceptable_java_type): Robustify. Use
	proper Boolean return type instead of return 1.
	(check_java_method): Don't issue error about
	type not being an acceptable Java parameter if 
	it's error_mark_node.

	* g++.dg/other/error12.C: New test.

From-SVN: r115474
parent e3beea68
2006-07-15 Lee Millward <lee.millward@gmail.com>
PR c++/28292
* decl2.c (acceptable_java_type): Robustify. Use
proper Boolean return type instead of return 1.
(check_java_method): Don't issue error about
type not being an acceptable Java parameter if
it's error_mark_node.
2006-07-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-07-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28249 PR c++/28249
......
...@@ -469,8 +469,11 @@ check_member_template (tree tmpl) ...@@ -469,8 +469,11 @@ check_member_template (tree tmpl)
static bool static bool
acceptable_java_type (tree type) acceptable_java_type (tree type)
{ {
if (type == error_mark_node)
return false;
if (TREE_CODE (type) == VOID_TYPE || TYPE_FOR_JAVA (type)) if (TREE_CODE (type) == VOID_TYPE || TYPE_FOR_JAVA (type))
return 1; return true;
if (TREE_CODE (type) == POINTER_TYPE || TREE_CODE (type) == REFERENCE_TYPE) if (TREE_CODE (type) == POINTER_TYPE || TREE_CODE (type) == REFERENCE_TYPE)
{ {
type = TREE_TYPE (type); type = TREE_TYPE (type);
...@@ -526,8 +529,9 @@ check_java_method (tree method) ...@@ -526,8 +529,9 @@ check_java_method (tree method)
tree type = TREE_VALUE (arg_types); tree type = TREE_VALUE (arg_types);
if (!acceptable_java_type (type)) if (!acceptable_java_type (type))
{ {
error ("Java method %qD has non-Java parameter type %qT", if (type != error_mark_node)
method, type); error ("Java method %qD has non-Java parameter type %qT",
method, type);
jerr = true; jerr = true;
} }
} }
......
2006-07-15 Lee Millward <lee.millward@gmail.com>
PR c++/28292
* g++.dg/other/error12.C: New test.
2006-07-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-07-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28249 PR c++/28249
//PR c++/28292
extern "Java"
{
struct A
{
void foo(void; // { dg-error "before|incomplete type|invalid use" }
};
}
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