public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/29018] empty enum accepted
       [not found] <bug-29018-4@http.gcc.gnu.org/bugzilla/>
@ 2012-10-11  0:34 ` paolo.carlini at oracle dot com
  0 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-11  0:34 UTC (permalink / raw)
  To: gcc-bugs


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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|gcc-bugs at gcc dot gnu.org |
         Resolution|                            |DUPLICATE

--- Comment #11 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-11 00:34:06 UTC ---
Special case.

*** This bug has been marked as a duplicate of bug 54216 ***


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

* [Bug c++/29018] empty enum accepted
  2006-09-11 16:02 [Bug c++/29018] New: " amylaar at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2007-09-04 17:53 ` pcarlini at suse dot de
@ 2007-09-17 19:18 ` pcarlini at suse dot de
  9 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2007-09-17 19:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pcarlini at suse dot de  2007-09-17 19:18 -------
Not actively working on it (for now)


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|pcarlini at suse dot de     |unassigned at gcc dot gnu
                   |                            |dot org
             Status|ASSIGNED                    |NEW


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


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

* [Bug c++/29018] empty enum accepted
  2006-09-11 16:02 [Bug c++/29018] New: " amylaar at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-09-04 17:47 ` pcarlini at suse dot de
@ 2007-09-04 17:53 ` pcarlini at suse dot de
  2007-09-17 19:18 ` pcarlini at suse dot de
  9 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2007-09-04 17:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pcarlini at suse dot de  2007-09-04 17:53 -------
Humm, no, anonymous enums are clearly legal, sorry about the stupid mistake.
Still, it's not completely clear to me the discussion in 7.2/5 of empty
enumerator-lists, evidently, we must assume those are illegal *only* when the
enum is simultaneously anonymous (and the patch in Comment #2 is therefore
incomplete, not completely wrong, sorry about the misunderstanding).


-- 


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


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

* [Bug c++/29018] empty enum accepted
  2006-09-11 16:02 [Bug c++/29018] New: " amylaar at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-09-04 16:52 ` pcarlini at suse dot de
@ 2007-09-04 17:47 ` pcarlini at suse dot de
  2007-09-04 17:53 ` pcarlini at suse dot de
  2007-09-17 19:18 ` pcarlini at suse dot de
  9 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2007-09-04 17:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pcarlini at suse dot de  2007-09-04 17:47 -------
Hummm, with reference to the patch in Comment #9: I don't think 'enum { };' is
flagged in the standard as ill-formed because of the empty enumerator-list
(that possibility is explicitly discussed in 7.2/5), but because the enum
doesn't have a name. In other terms, the example is ill-formed for the very
same reason anonymous structs are a GNU extension. In yet other terms, it seems
to me we have got an anonymous enum extension, which probably we want to
diagnose when pedantic.


-- 


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


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

* [Bug c++/29018] empty enum accepted
  2006-09-11 16:02 [Bug c++/29018] New: " amylaar at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-01-24 16:06 ` sje at cup dot hp dot com
@ 2007-09-04 16:52 ` pcarlini at suse dot de
  2007-09-04 17:47 ` pcarlini at suse dot de
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2007-09-04 16:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pcarlini at suse dot de  2007-09-04 16:51 -------
On it.


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pcarlini at suse dot de
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/29018] empty enum accepted
  2006-09-11 16:02 [Bug c++/29018] New: " amylaar at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-01-24  1:31 ` manu at gcc dot gnu dot org
@ 2007-01-24 16:06 ` sje at cup dot hp dot com
  2007-09-04 16:52 ` pcarlini at suse dot de
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: sje at cup dot hp dot com @ 2007-01-24 16:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from sje at cup dot hp dot com  2007-01-24 16:05 -------
Well, "I think" is all I can give.  I am not a maintainer who can approve a
patch for this.  If you want to work on it I would recommend doing a patch that
just involves a small subset of the test suite fixes and see if you can get the
attention of someone who can approve such a patch.  Once some testsuite changes
have been approved it will probably be easier to get the rest of the testsuite
changes approved (maybe even preapproved).


-- 


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


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

* [Bug c++/29018] empty enum accepted
  2006-09-11 16:02 [Bug c++/29018] New: " amylaar at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-01-24  0:34 ` sje at cup dot hp dot com
@ 2007-01-24  1:31 ` manu at gcc dot gnu dot org
  2007-01-24 16:06 ` sje at cup dot hp dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-01-24  1:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from manu at gcc dot gnu dot org  2007-01-24 01:31 -------
(In reply to comment #4)
> I think we want to fix the test cases, but I don't want to sign up to fix them
> myself.
> 

"I think" is not enough. It would be nice to be able tell to whoever takes the
burden of implementing this that fixing the testcases is OK and that such patch
will be approved (and give any hints about the better way to fix the
testcases). Since this affects testcases for g++ and libstdc++, this may
require approval from more than one maintainer.


-- 


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


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

* [Bug c++/29018] empty enum accepted
  2006-09-11 16:02 [Bug c++/29018] New: " amylaar at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-01-21 18:24 ` manu at gcc dot gnu dot org
@ 2007-01-24  0:34 ` sje at cup dot hp dot com
  2007-01-24  1:31 ` manu at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: sje at cup dot hp dot com @ 2007-01-24  0:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from sje at cup dot hp dot com  2007-01-24 00:34 -------
I think we want to fix the test cases, but I don't want to sign up to fix them
myself.


-- 


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


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

* [Bug c++/29018] empty enum accepted
  2006-09-11 16:02 [Bug c++/29018] New: " amylaar at gcc dot gnu dot org
  2006-09-11 16:09 ` [Bug c++/29018] " pinskia at gcc dot gnu dot org
  2006-09-15 16:46 ` sje at cup dot hp dot com
@ 2007-01-21 18:24 ` manu at gcc dot gnu dot org
  2007-01-24  0:34 ` sje at cup dot hp dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-01-21 18:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from manu at gcc dot gnu dot org  2007-01-21 18:24 -------
So, do we want to fix those testcases or do we want to keep ignoring empty
enums?


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu dot org


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


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

* [Bug c++/29018] empty enum accepted
  2006-09-11 16:02 [Bug c++/29018] New: " amylaar at gcc dot gnu dot org
  2006-09-11 16:09 ` [Bug c++/29018] " pinskia at gcc dot gnu dot org
@ 2006-09-15 16:46 ` sje at cup dot hp dot com
  2007-01-21 18:24 ` manu at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: sje at cup dot hp dot com @ 2006-09-15 16:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from sje at cup dot hp dot com  2006-09-15 16:46 -------
I took a quick look at this bug, the fix is easy, I have included a patch I
created.  The problem is that there are 172 tests in the g++ and libstdc++
test suites that have empty enums in them.  If we give an error on empty enums
we will need to fix a lot of tests.

Patch:

Index: gcc/cp/parser.c
===================================================================
--- gcc/cp/parser.c     (revision 116960)
+++ gcc/cp/parser.c     (working copy)
@@ -10317,8 +10317,10 @@ cp_parser_enum_specifier (cp_parser* par
       return error_mark_node;
     }

-  /* If the next token is not '}', then there are some enumerators.  */
-  if (cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_BRACE))
+  /* An empty enum is not allowed.  */
+  if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE))
+    error ("an enum may not be empty");
+  else
     cp_parser_enumerator_list (parser, type);

   /* Consume the final '}'.  */


-- 

sje at cup dot hp dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sje at cup dot hp dot com


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


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

* [Bug c++/29018] empty enum accepted
  2006-09-11 16:02 [Bug c++/29018] New: " amylaar at gcc dot gnu dot org
@ 2006-09-11 16:09 ` pinskia at gcc dot gnu dot org
  2006-09-15 16:46 ` sje at cup dot hp dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-11 16:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-09-11 16:09 -------
Confirmed, not a regression.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|3.2.3 4.1.0 4.2.0           |3.2.3 4.1.0 4.2.0 2.95.3
                   |                            |3.0.4 3.4.0 3.3.3
   Last reconfirmed|0000-00-00 00:00:00         |2006-09-11 16:09:24
               date|                            |


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


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

end of thread, other threads:[~2012-10-11  0:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-29018-4@http.gcc.gnu.org/bugzilla/>
2012-10-11  0:34 ` [Bug c++/29018] empty enum accepted paolo.carlini at oracle dot com
2006-09-11 16:02 [Bug c++/29018] New: " amylaar at gcc dot gnu dot org
2006-09-11 16:09 ` [Bug c++/29018] " pinskia at gcc dot gnu dot org
2006-09-15 16:46 ` sje at cup dot hp dot com
2007-01-21 18:24 ` manu at gcc dot gnu dot org
2007-01-24  0:34 ` sje at cup dot hp dot com
2007-01-24  1:31 ` manu at gcc dot gnu dot org
2007-01-24 16:06 ` sje at cup dot hp dot com
2007-09-04 16:52 ` pcarlini at suse dot de
2007-09-04 17:47 ` pcarlini at suse dot de
2007-09-04 17:53 ` pcarlini at suse dot de
2007-09-17 19:18 ` pcarlini at suse dot de

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