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] |
Thanks for working on this. A cleaner fix would be to but a call to require_complete_type in build_new (rather than build_new_1).
The TYPE argument to build_new is either the type being allocated, or the type of the array elements. In either case, it must be a complete type. So, after the other checks (for REFERENCE_TYPE and FUNCTION_TYPE) in build_new, you could just do:
type = require_complete_type (type); if (type == error_mark_node) return error_mark_node;
Then, remove the complete_type_or_else call from build_new_1. (The only
caller of build_new_1 is build_new.)
I tried this and it yields the inaccurate diagnostic 31743.C:2: error: cannot convert ‘int*’ to ‘int (*)[]’ in initialization
Please also include a testcase with your submission.Sorry. I figured the test case in the bug report was sufficient. Attaching a test case to this message.
Attachment:
31743.C
Description: application/unknown-content-type-c_auto_file
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |