public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/45607]  New: Inappropriate error message
@ 2010-09-09  3:30 anubhav dot saxena at wipro dot com
  2010-09-09  9:48 ` [Bug c++/45607] [4.3/4.4 Regression] Confusing " rguenth at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: anubhav dot saxena at wipro dot com @ 2010-09-09  3:30 UTC (permalink / raw)
  To: gcc-bugs

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

struct A{
   enum A {yesterday, today, tomorrow};
};

int main(){}

The code above gives error

prog.cpp:2: error: ‘class A’ has the same name as the class in which it is
declared

It is at the best confusing. The error message could probably be 'declaration
of a memeber of the same name as the class in which it is declared' or
something similar


-- 
           Summary: Inappropriate error message
           Product: gcc
           Version: 4.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anubhav dot saxena at wipro dot com


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


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

* [Bug c++/45607] [4.3/4.4 Regression] Confusing error message
  2010-09-09  3:30 [Bug c++/45607] New: Inappropriate error message anubhav dot saxena at wipro dot com
@ 2010-09-09  9:48 ` rguenth at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-09  9:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2010-09-09 09:47 -------
4.5 prints

t.C:2:13: error: 'A::A' has the same name as the class in which it is declared

3.4

t.C:2: error: `enum A::A' has the same name as the class in which it is
declared

which is nicest.  4.0 to 4.4 exhibit the behavior as described in this bug.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to work|                            |3.4.6 4.5.1 4.6.0
   Last reconfirmed|0000-00-00 00:00:00         |2010-09-09 09:47:36
               date|                            |
            Summary|Inappropriate error message |[4.3/4.4 Regression]
                   |                            |Confusing error message
   Target Milestone|---                         |4.4.5


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


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

end of thread, other threads:[~2010-09-09  9:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-09  3:30 [Bug c++/45607] New: Inappropriate error message anubhav dot saxena at wipro dot com
2010-09-09  9:48 ` [Bug c++/45607] [4.3/4.4 Regression] Confusing " rguenth 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).