This is the mail archive of the
mailing list for the GCC project.
Re: [C++ PATCH for 3.4/4.0] Fix PR18123 (check error_mark_node inpushtag)
- From: Mark Mitchell <mark at codesourcery dot com>
- To: lerdsuwa at users dot sf dot net
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 03 Nov 2004 10:48:39 -0800
- Subject: Re: [C++ PATCH for 3.4/4.0] Fix PR18123 (check error_mark_node inpushtag)
- Organization: CodeSourcery, LLC
- References: <4188CD48.firstname.lastname@example.org>
Kriang Lerdsuwanakij wrote:
This is a case of checking for 'error_mark_node' in 'pushtag'.
'maybe_process_template_type_declaration' may return 'error_mark_node'
which should not be pushed into the scope in later pushdecl_* functons.
However, we cannot return immediately as the caller will use the
type node for further processing. So we need to keep the type node
consistent by setting its TYPE_STUB_DECL.
Tested on i686-pc-linux-gnu. OK for the mainline and 3.4 (after 3.4.3
I think it would be more robust to do a change similar to my recent fix
for 18155. In particular, put a check in cp_parser_single_declaration
for "enum", and issue the error there. That keeps us from even trying
to create tree structures for this type. Arguably, that will hurt error
recovery in that we don't know what this thing is a type at all -- but I
am not concerned. The first error message will be very sensible, and
trying to make the front end deal with semi-bogus types/declarations is