[Bug c++/33975] [4.1/4.2/4.3 Regression] Incomplete types may be derefenced
janis at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Nov 12 18:01:00 GMT 2007
------- 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
More information about the Gcc-bugs
mailing list