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]

Re: [patch] Fix PR c++/28250: ICE with invalid catch


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


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