public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "janis at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/33975] [4.1/4.2/4.3 Regression] Incomplete types may be derefenced
Date: Mon, 12 Nov 2007 18:01:00 -0000	[thread overview]
Message-ID: <20071112180153.11237.qmail@sourceware.org> (raw)
In-Reply-To: <bug-33975-10252@http.gcc.gnu.org/bugzilla/>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 711 bytes --]



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


  parent reply	other threads:[~2007-11-12 18:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-01 17:58 [Bug c++/33975] New: " andrew dot stubbs at st dot com
2007-11-02 13:59 ` [Bug c++/33975] " rguenth at gcc dot gnu dot org
2007-11-12 18:01 ` janis at gcc dot gnu dot org [this message]
2007-11-12 19:50 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071112180153.11237.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).