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)?