This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
PR 28292 is another example of where the C++ front-end ICE's with a tree check failure because of an error_mark_node in acceptable_java_type.
The proposed patch below fixes the ICE by adding a check to acceptable_java_type for the input type being error_mark_node and returning false immediately if it is. As a consequence of this the compiler output for the testcase is then the following:
error12.C:7: error: expected `)' before ';' token error12.C:7: error: '<anonymous>' has incomplete type error12.C:7: error: invalid use of 'void' error12.C:7: error: Java method 'void A::foo(<type error>)' has non-Java parameter type '<type error>'
The <type error> in the final error message originates in check_java_method because of type being error_mark_node, so the final portion of the patch conditionalises the issuing of the error message on type not being error_mark_node, with this the output becomes the following:
error12.C:7: error: expected `)' before ';' token error12.C:7: error: '<anonymous>' has incomplete type error12.C:7: error: invalid use of 'void'
Bootstrapped and regression tested with no new failures on i686-pc-linux-gnu. Ok for mainline?
Cheers, Lee.
PR c++/28292 * decl2.c (acceptable_java_type): Robustify. (check_java_method): Don't issue error about type not being an acceptable Java parameter if it's error_mark_node.
PR c++/28292 * g++.dg/other/error12.C: New test.
Attachment:
pr28292.txt
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |