[patch] Fix PR c++/23089, ICE on incomplete function parameter
Mark Mitchell
mark@codesourcery.com
Mon Aug 22 00:23:00 GMT 2005
Volker Reichelt wrote:
> Consider the following C++ testcase:
>
> void foo(struct A) {}
>
> When compiling this with -O we get an ICE after a sensible error message:
>
> PR23089.cc: In function 'void foo(A)':
> PR23089.cc:1: error: '<anonymous>' has incomplete type
> PR23089.cc:1: error: forward declaration of 'struct A'
> PR23089.cc:1: internal compiler error: in int_mode_for_mode, at stor-layout.c:248
>
> The following patch fixes the ICE by marking the function parameter as
> invalid after it has been diagnosed as incomplete. (We already did this
> for a void parameter.)
>
> Bootstrapped and regtested on i686-pc-linux-gnu.
> Ok for mainline and 4.0 branch (since it's a regression)?
OK.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304
More information about the Gcc-patches
mailing list