This is the mail archive of the gcc@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]

Re: incomplete type return types


Mark Mitchell <mark@codesourcery.com> writes:

| Gabriel Dos Reis wrote:
| 
| > The resason here is that, after we complained that A is incomplete
| > (therefore cannot be used as return type in the function definition),
| > cp/decl.c:check_function_type() changes the return type to void, thus 
| > giving misleading diagnostic later.
| 
| That's the bug.  It should change the return type to error_mark_node,
| and then the code that check returns should be silent in that case.

It turns out that start_preparsed_function() is a one-way drive-thru,
i.e., there is no early exit and it does not check for whatever
check_function_type() did.  Setting the return type to error_mark_node
makes the compiler die later in build_function_type -- which is
unprepared to have error_mark_node as inputs.  Would prefer to have
build_function_type() also modified to be nice to error_mark_node?

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]