This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix PR c++/28250: ICE with invalid catch
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Volker Reichelt <reichelt at igpm dot rwth-aachen dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 06 Jul 2006 18:25:53 -0700
- Subject: Re: [patch] Fix PR c++/28250: ICE with invalid catch
- References: <tkrat.5644d9310ff55244@igpm.rwth-aachen.de>
Volker Reichelt wrote:
> The following invalid code snippet causes an ICE on mainline:
>
> template<int> void foo()
> {
> try {}
> catch (int(0)) {}
> }
>
> bug.cc: In function 'void foo()':
> bug.cc:4: error: expected `)' before numeric constant
> bug.cc:4: internal compiler error: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in pushdecl_maybe_friend, at cp/name-lookup.c:574
> Please submit a full bug report, [etc.]
>
> The patch below fixes this by replacing an invalid decl in
> finish_handler_parms by a NULL_TREE (which indicates a "...").
Won't this cause problems for something like:
try {}
catch (<error>) {}
catch (...) {}
in that you will now get an error about having two "..." clauses? And
why does the proble only occur in templates?
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713