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

* [Bug c++/15786] [3.4/3.5 Regression] Bad error message for frequently occuring error.
  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 ` pinskia at gcc dot gnu dot org
  2004-06-04 20:18 ` mmitchel at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-02 22:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-02 22:20 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2004-06-02 22:20:12
               date|                            |
            Summary|[regression 3.5/3.4.0] Bad  |[3.4/3.5 Regression] Bad
                   |error message for frequently|error message for frequently
                   |occuring error.             |occuring error.
   Target Milestone|---                         |3.4.1


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


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

* [Bug c++/15786] [3.4/3.5 Regression] Bad error message for frequently occuring error.
  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
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-06-04 20:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-06-04 20:18 -------
This is not a showstopper.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.1                       |3.4.2


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


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

* [Bug c++/15786] [3.4/3.5 Regression] Bad error message for frequently occuring error.
  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
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2004-07-22 12:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-07-22 12:58 -------
*** Bug 16151 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |igodard at pacbell dot net


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


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

* [Bug c++/15786] [3.4/3.5 Regression] Bad error message for frequently occuring error.
  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
                   ` (2 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-08-29 18:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-08-29 18:51 -------
Postponed until GCC 3.4.3.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.2                       |3.4.3


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


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

* [Bug c++/15786] [3.4/4.0 Regression] Bad error message for frequently occuring error.
  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
                   ` (3 preceding siblings ...)
  2004-08-29 18:51 ` mmitchel at gcc dot gnu dot org
@ 2004-10-12  0:11 ` mmitchel at gcc dot gnu dot org
  2004-10-12  1:52 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-10-12  0:11 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED
      Known to fail|3.4.1 4.0                   |3.4.1 4.0.0


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


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

* [Bug c++/15786] [3.4/4.0 Regression] Bad error message for frequently occuring error.
  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
                   ` (4 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-10-12  1:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-10-12 01:52 -------
Subject: Bug 15786

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-10-12 01:52:20

Modified files:
	gcc/cp         : ChangeLog parser.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/parse: error22.C 

Log message:
	PR c++/15786
	* parser.c (cp_parser_declarator): Add member_p parameter.
	(cp_parser_condition): Adjust calls to cp_parser_declarator.
	(cp_parser_explicit_instantiation): Likewise.
	(cp_parser_init_declarator): Likewise.
	(cp_parser_direct_declarator): Add member_p parameter.  Do not
	parse tentatively when parsing the parameters to a member.
	(cp_parser_type_id): Adjust calls to cp_parser_declarator.
	(cp_parser_parameter_declaration): Likewise.
	(cp_parser_member_declaration): Likewise.
	(cp_parser_exception_declaration): Likewise.
	
	PR c++/15876
	* g++.dg/parse/error22.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4426&r2=1.4427
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.262&r2=1.263
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4438&r2=1.4439
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/error22.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c++/15786] [3.4/4.0 Regression] Bad error message for frequently occuring error.
  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
                   ` (5 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-10-12  3:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-10-12 03:07 -------
Subject: Bug 15786

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2004-10-12 03:07:16

Modified files:
	gcc/cp         : ChangeLog parser.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/parse: error22.C 

Log message:
	PR c++/15786
	* parser.c (cp_parser_declarator): Add member_p parameter.
	(cp_parser_condition): Adjust calls to cp_parser_declarator.
	(cp_parser_explicit_instantiation): Likewise.
	(cp_parser_init_declarator): Likewise.
	(cp_parser_direct_declarator): Add member_p parameter.  Do not
	parse tentatively when parsing the parameters to a member.
	(cp_parser_type_id): Adjust calls to cp_parser_declarator.
	(cp_parser_parameter_declaration): Likewise.
	(cp_parser_member_declaration): Likewise.
	(cp_parser_exception_declaration): Likewise.
	
	PR c++/15876
	* g++.dg/parse/error22.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.168&r2=1.3892.2.169
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.157.2.43&r2=1.157.2.44
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.284&r2=1.3389.2.285
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/error22.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

* [Bug c++/15786] [3.4/4.0 Regression] Bad error message for frequently occuring error.
  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
                   ` (6 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-10-12  3:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-10-12 03:17 -------
Fixed in GCC 3.4.3.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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