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++/23089, ICE on incomplete function parameter


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


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