This is the mail archive of the gcc-bugs@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]

[Bug c++/33975] [4.1/4.2/4.3 Regression] Incomplete types may be derefenced



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


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