public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15786] New: [regression 3.5/3.4.0] Bad error message for frequently occuring error.
@ 2004-06-02 21:28 carlo at gcc dot gnu dot org
  2004-06-02 22:20 ` [Bug c++/15786] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: carlo at gcc dot gnu dot org @ 2004-06-02 21:28 UTC (permalink / raw)
  To: gcc-bugs

I've run so many times into this now that I feel that it is important to get it
fixed.

The following code snippet,

struct A {
  void foo(bar* p);
};

Gives as error message:

>g++-cvs-3.5 -c test.cc
test.cc:2: error: variable or field `foo' declared void
test.cc:2: error: expected `;' before '(' token

Only when foo is not a member function, there also appears
a MUCH more correct error message:

test.cc:1: error: variable or field `foo' declared void
test.cc:1: error: `bar' was not declared in this scope
test.cc:1: error: `p' was not declared in this scope

If possible, the `bar' was not declared in this scope should
come first - and it should definitely also be printed in
the case of the member function.

3.4.0 does the same unclear thing.

You can consider this a regression because 3.3.3 gives most
sensible output:

>g++-3.3.3 -c test.cc
test.cc:2: error: `bar' was not declared in this scope
test.cc:2: error: `p' was not declared in this scope
test.cc:2: error: invalid data member initialization
test.cc:2: error: (use `=' to initialize static data members)
test.cc:2: error: variable or field `foo' declared void

-- 
           Summary: [regression 3.5/3.4.0] Bad error message for frequently
                    occuring error.
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: carlo at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-10-12  3:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-02 21:28 [Bug c++/15786] New: [regression 3.5/3.4.0] Bad error message for frequently occuring error carlo at gcc dot gnu dot org
2004-06-02 22:20 ` [Bug c++/15786] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
2004-06-04 20:18 ` mmitchel at gcc dot gnu dot org
2004-07-22 12:58 ` bangerth at dealii dot org
2004-08-29 18:51 ` mmitchel at gcc dot gnu dot org
2004-10-12  0:11 ` [Bug c++/15786] [3.4/4.0 " mmitchel at gcc dot gnu dot org
2004-10-12  1:52 ` cvs-commit at gcc dot gnu dot org
2004-10-12  3:07 ` cvs-commit at gcc dot gnu dot org
2004-10-12  3:17 ` mmitchel at gcc dot gnu dot org

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