public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bernie at develer dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/16189] New: obfuscated error message for missing semicolon after declaration in C++
Date: Fri, 25 Jun 2004 02:25:00 -0000	[thread overview]
Message-ID: <20040625022408.16189.bernie@develer.com> (raw)

Diagnostic for missing semicolons after struct/class
declarations regressed in 3.4.x.

The misleading error message is also reported on
the *last* line of the *following* struct/class
declaration, which makes it hard for the user to
hunt for the source line containing the error.

Additionally, the message is inconsistent
between the C and C++ front ends for no apparent
reason.


$ cat >foo.cc
struct Foo { int i; }   // semicolon missing
struct Bar { int i; };

$ g++341 foo.cc
foo.cc:2: error: multiple types in one declaration

$ mv foo.cc foo.c
$ gcc341 foo.c
foo.c:2: error: two types specified in one empty declaration

$ g++333 foo.cc
foo.cc:2: error: semicolon missing after declaration of `Foo'
foo.cc:2: error: multiple types in one declaration

-- 
           Summary: obfuscated error message for missing semicolon after
                    declaration in C++
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bernie at develer dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


             reply	other threads:[~2004-06-25  2:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-25  2:25 bernie at develer dot com [this message]
2004-06-25  2:26 ` [Bug c++/16189] " bernie at develer dot com
2004-06-25  6:35 ` pinskia at gcc dot gnu dot org
2004-07-27 21:25 ` jleatherwood at acm dot org
2004-07-27 22:14 ` bangerth at dealii dot org
2004-07-27 22:47 ` schwab at suse dot de
2004-07-27 23:00 ` jsm at polyomino dot org dot uk
2004-07-28  1:43 ` bernie at develer dot com
2004-07-28  5:26 ` neil at gcc dot gnu dot org
2004-07-31  0:24 ` giovannibajo at libero dot it

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=20040625022408.16189.bernie@develer.com \
    --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).