------- Comment #2 from janis at gcc dot gnu dot org  2007-11-12 18:01 -------
Mainline now reports an error for this code:

elm3b187% /opt/gcc-nightly/trunk/bin/g++ 33975.cc
33975.cc: In function ‘int main()’:
33975.cc:8: error: invalid use of incomplete type ‘struct S’
33975.cc:1: error: forward declaration of ‘struct S’
33975.cc:8: error:   initializing argument 1 of ‘int f(S)’

The patch that fixed this for mainline:

    http://gcc.gnu.org/viewcvs?view=rev&rev=129968

    r129968 | jakub | 2007-11-07 19:27:27 +0000 (Wed, 07 Nov 2007)

Here's the source file I used:

struct S;
int f(S s);

int
main ()
{
  S *p;
  int i = f(*p);
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33975

Reply via email to