public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/25635]  New: [4.0/4.1/4.2 regression] Bogus cruft in error message for invalid operator declaration
@ 2006-01-02 12:59 reichelt at gcc dot gnu dot org
  2006-01-02 16:49 ` [Bug c++/25635] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-01-02 12:59 UTC (permalink / raw)
  To: gcc-bugs

The diagnostic for the following invalid code snippet got worse with
GCC 4.0.0:

=============================================
struct A {};

A::operator int();
=============================================

We now issue a duplicate message and some more bogus stuff:

  bug.cc:3: error: no 'A::operator int()' member function declared in class 'A'
  bug.cc:3: error: no 'A::operator int()' member function declared in class 'A'
  bug.cc:3: error: 'A::operator int()' cannot be overloaded
  bug.cc:3: error: with 'A::operator int()'
  bug.cc:3: error: declaration of 'A::operator int()' outside of class is not
definition

We used to issue the following message which looks OK to me:

  bug.cc:3: error: no `A::operator int()' member function declared in class `A'
  bug.cc:3: error: declaration of `A::operator int()' outside of class is not
definition

For a normal member function like "void A::foo()" the error message is OK.


-- 
           Summary: [4.0/4.1/4.2 regression] Bogus cruft in error message
                    for invalid operator declaration
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: diagnostic, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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



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

* [Bug c++/25635] [4.0/4.1/4.2 regression] Bogus cruft in error message for invalid operator declaration
  2006-01-02 12:59 [Bug c++/25635] New: [4.0/4.1/4.2 regression] Bogus cruft in error message for invalid operator declaration reichelt at gcc dot gnu dot org
@ 2006-01-02 16:49 ` pinskia at gcc dot gnu dot org
  2006-01-03  0:43 ` mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-02 16:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-01-02 16:49 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|                            |4.0.0 4.1.0 4.2.0
      Known to work|                            |3.4.0
   Last reconfirmed|0000-00-00 00:00:00         |2006-01-02 16:49:19
               date|                            |
   Target Milestone|---                         |4.0.3


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



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

* [Bug c++/25635] [4.0/4.1/4.2 regression] Bogus cruft in error message for invalid operator declaration
  2006-01-02 12:59 [Bug c++/25635] New: [4.0/4.1/4.2 regression] Bogus cruft in error message for invalid operator declaration reichelt at gcc dot gnu dot org
  2006-01-02 16:49 ` [Bug c++/25635] " pinskia at gcc dot gnu dot org
@ 2006-01-03  0:43 ` mmitchel at gcc dot gnu dot org
  2006-01-03  8:38 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-03  0:43 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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



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

* [Bug c++/25635] [4.0/4.1/4.2 regression] Bogus cruft in error message for invalid operator declaration
  2006-01-02 12:59 [Bug c++/25635] New: [4.0/4.1/4.2 regression] Bogus cruft in error message for invalid operator declaration reichelt at gcc dot gnu dot org
  2006-01-02 16:49 ` [Bug c++/25635] " pinskia at gcc dot gnu dot org
  2006-01-03  0:43 ` mmitchel at gcc dot gnu dot org
@ 2006-01-03  8:38 ` mmitchel at gcc dot gnu dot org
  2006-01-03  8:40 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-03  8:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from mmitchel at gcc dot gnu dot org  2006-01-03 08:38 -------
Subject: Bug 25635

Author: mmitchel
Date: Tue Jan  3 08:38:22 2006
New Revision: 109268

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109268
Log:
        PR c++/25635
        * class.c (add_method): Set TYPE_HAS_CONVERSION for classes with a
        conversion operator.
        * decl.c (grokdeclarator): Do not set TYPE_HAS_CONVERSION here.
        PR c++/25638
        * class.c (add_method): Never associate more than one destructor
        with a single class.
        PR c++/25637
        * decl.c (grokdeclarator): Refine check for invalid
        declarations/definitions of member functions outside of their own
        class.
        PR c++/25633
        * parser.c (cp_parser_mem_initializer_list): Check result of
        cp_parser_mem_initializer against error_mark_node, not NULL_TREE.
        (cp_parser_mem_initializer): Return error_mark_node for failure.
        PR c++/25634
        * parser.c (cp_parser_elaborated_type_specifier): Call
        cp_parser_check_template_parameters.
        PR c++/25635
        * g++.dg/parse/operator6.C: New test.
        PR c++/25637
        * g++.dg/parse/error29.C: New test.
        PR c++/25638
        * g++.dg/parse/dtor6.C: New test.
        PR c++/25633
        * g++.dg/parse/ctor3.C: New test.
        PR c++/25634
        * g++.dg/template/class3.C: New test.

Added:
    branches/gcc-4_0-branch/gcc/testsuite/g++.dg/parse/ctor3.C
    branches/gcc-4_0-branch/gcc/testsuite/g++.dg/parse/dtor6.C
    branches/gcc-4_0-branch/gcc/testsuite/g++.dg/parse/error29.C
    branches/gcc-4_0-branch/gcc/testsuite/g++.dg/parse/operator6.C
    branches/gcc-4_0-branch/gcc/testsuite/g++.dg/template/class3.C
Modified:
    branches/gcc-4_0-branch/gcc/cp/ChangeLog
    branches/gcc-4_0-branch/gcc/cp/class.c
    branches/gcc-4_0-branch/gcc/cp/decl.c
    branches/gcc-4_0-branch/gcc/cp/parser.c
    branches/gcc-4_0-branch/gcc/testsuite/ChangeLog


-- 


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



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

* [Bug c++/25635] [4.0/4.1/4.2 regression] Bogus cruft in error message for invalid operator declaration
  2006-01-02 12:59 [Bug c++/25635] New: [4.0/4.1/4.2 regression] Bogus cruft in error message for invalid operator declaration reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-01-03  8:38 ` mmitchel at gcc dot gnu dot org
@ 2006-01-03  8:40 ` mmitchel at gcc dot gnu dot org
  2006-01-03  8:41 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-03  8:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from mmitchel at gcc dot gnu dot org  2006-01-03 08:40 -------
Subject: Bug 25635

Author: mmitchel
Date: Tue Jan  3 08:40:18 2006
New Revision: 109269

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109269
Log:
        PR c++/25635
        * class.c (add_method): Set TYPE_HAS_CONVERSION for classes with a
        conversion operator.
        * decl.c (grokdeclarator): Do not set TYPE_HAS_CONVERSION here.
        PR c++/25638
        * class.c (add_method): Never associate more than one destructor
        with a single class.
        PR c++/25637
        * decl.c (grokdeclarator): Refine check for invalid
        declarations/definitions of member functions outside of their own
        class.
        PR c++/25633
        * parser.c (cp_parser_mem_initializer_list): Check result of
        cp_parser_mem_initializer against error_mark_node, not NULL_TREE.
        (cp_parser_mem_initializer): Return error_mark_node for failure.
        PR c++/25634
        * parser.c (cp_parser_elaborated_type_specifier): Call
        cp_parser_check_template_parameters.
        PR c++/25635
        * g++.dg/parse/operator6.C: New test.
        PR c++/25637
        * g++.dg/parse/error29.C: New test.
        PR c++/25638
        * g++.dg/parse/dtor6.C: New test.
        PR c++/25633
        * g++.dg/parse/ctor3.C: New test.
        PR c++/25634
        * g++.dg/template/class3.C: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/parse/ctor3.C
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/parse/dtor6.C
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/parse/error29.C
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/parse/operator6.C
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/class3.C
Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/class.c
    branches/gcc-4_1-branch/gcc/cp/decl.c
    branches/gcc-4_1-branch/gcc/cp/parser.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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



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

* [Bug c++/25635] [4.0/4.1/4.2 regression] Bogus cruft in error message for invalid operator declaration
  2006-01-02 12:59 [Bug c++/25635] New: [4.0/4.1/4.2 regression] Bogus cruft in error message for invalid operator declaration reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-01-03  8:40 ` mmitchel at gcc dot gnu dot org
@ 2006-01-03  8:41 ` mmitchel at gcc dot gnu dot org
  2006-01-03  8:46 ` mmitchel at gcc dot gnu dot org
  2006-07-19 10:50 ` reichelt at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-03  8:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from mmitchel at gcc dot gnu dot org  2006-01-03 08:41 -------
Subject: Bug 25635

Author: mmitchel
Date: Tue Jan  3 08:41:21 2006
New Revision: 109270

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109270
Log:
        PR c++/25635
        * class.c (add_method): Set TYPE_HAS_CONVERSION for classes with a
        conversion operator.
        * decl.c (grokdeclarator): Do not set TYPE_HAS_CONVERSION here.
        PR c++/25638
        * class.c (add_method): Never associate more than one destructor
        with a single class.
        PR c++/25637
        * cp-tree.h (do_friend): Adjust prototype.
        * decl.c (grokfndecl): Make funcdef_flag a bool, not an int.
        (grokdeclarator): Likewise.  Refine check for invalid
        declarations/definitions of member functions outside of their own
        class.
        * friend.c (do_friend): Make funcdef_flag a bool, not an int.
        PR c++/25633
        * parser.c (cp_parser_mem_initializer_list): Check result of
        cp_parser_mem_initializer against error_mark_node, not NULL_TREE.
        (cp_parser_mem_initializer): Return error_mark_node for failure.
        PR c++/25634
        * parser.c (cp_parser_template_parameter_list): Call
        begin_template_parm_list and end_template_parm_list here.
        (cp_parser_type_parameter): Not here.
        (cp_parser_template_declaration_after_export): Or here.
        (cp_parser_elaborated_type_specifier): Call
        cp_parser_check_template_parameters.
        * tree.c (build_target_expr_with_type): Use force_target_expr.
        PR c++/25635
        * g++.dg/parse/operator6.C: New test.
        PR c++/25637
        * g++.dg/parse/error29.C: New test.
        PR c++/25638
        * g++.dg/parse/dtor6.C: New test.
        PR c++/25633
        * g++.dg/parse/ctor3.C: New test.
        PR c++/25634
        * g++.dg/template/class3.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/parse/ctor3.C
    trunk/gcc/testsuite/g++.dg/parse/dtor6.C
    trunk/gcc/testsuite/g++.dg/parse/error29.C
    trunk/gcc/testsuite/g++.dg/parse/operator6.C
    trunk/gcc/testsuite/g++.dg/template/class3.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/friend.c
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/tree.c
    trunk/gcc/testsuite/ChangeLog


-- 


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



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

* [Bug c++/25635] [4.0/4.1/4.2 regression] Bogus cruft in error message for invalid operator declaration
  2006-01-02 12:59 [Bug c++/25635] New: [4.0/4.1/4.2 regression] Bogus cruft in error message for invalid operator declaration reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-01-03  8:41 ` mmitchel at gcc dot gnu dot org
@ 2006-01-03  8:46 ` mmitchel at gcc dot gnu dot org
  2006-07-19 10:50 ` reichelt at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-03  8:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from mmitchel at gcc dot gnu dot org  2006-01-03 08:46 -------
Fixed in 4.0.3.


-- 

mmitchel at gcc dot gnu dot org changed:

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


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



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

* [Bug c++/25635] [4.0/4.1/4.2 regression] Bogus cruft in error message for invalid operator declaration
  2006-01-02 12:59 [Bug c++/25635] New: [4.0/4.1/4.2 regression] Bogus cruft in error message for invalid operator declaration reichelt at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2006-01-03  8:46 ` mmitchel at gcc dot gnu dot org
@ 2006-07-19 10:50 ` reichelt at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-07-19 10:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from reichelt at gcc dot gnu dot org  2006-07-19 10:50 -------
The duplicate message reappeared yesterday (but not the bogus stuff).
This is tracked in PR 28432.


-- 


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


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

end of thread, other threads:[~2006-07-19 10:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-02 12:59 [Bug c++/25635] New: [4.0/4.1/4.2 regression] Bogus cruft in error message for invalid operator declaration reichelt at gcc dot gnu dot org
2006-01-02 16:49 ` [Bug c++/25635] " pinskia at gcc dot gnu dot org
2006-01-03  0:43 ` mmitchel at gcc dot gnu dot org
2006-01-03  8:38 ` mmitchel at gcc dot gnu dot org
2006-01-03  8:40 ` mmitchel at gcc dot gnu dot org
2006-01-03  8:41 ` mmitchel at gcc dot gnu dot org
2006-01-03  8:46 ` mmitchel at gcc dot gnu dot org
2006-07-19 10:50 ` reichelt 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).