public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54216] New: Missing diagnostic for ill-formed anonymous enum declarations
@ 2012-08-10 0:18 frankhb1989 at gmail dot com
2012-08-10 0:21 ` [Bug c++/54216] " frankhb1989 at gmail dot com
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: frankhb1989 at gmail dot com @ 2012-08-10 0:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54216
Bug #: 54216
Summary: Missing diagnostic for ill-formed anonymous enum
declarations
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: frankhb1989@gmail.com
G++(-pedantic-errors) wrongly accepts following non-conforming enumeration
declarations(in namespace scope or block scope) and no diagnostic output at
all:
enum {}; //-std=c++98 or -std=c++11
enum class {}; //-std=c++11
enum class { x }; //-std=c++11
According the standard, all of them are ill-formed:
(for the first declaration)
ISO C++98/03/11
7/3 ...
[Example:
enum { }; // ill-formed
typedef class { }; // ill-formed
—end example]
(for others)
ISO C++11
7.2/2 ... The optional identifier shall not be omitted in the declaration of a
scoped enumeration. ...
While clang++(trunk, also using -pedantic-errors) rejects them correctly:
(for the first declaration, -std=c++98 or -std=c++11)
error: declaration does not declare anything
[-Werror,-Wmissing-declarations]
enum {};
^~~~
(for others, -std=c++11)
error: scoped enumeration requires a name
enum class { };
^
error: declaration does not declare anything
[-Werror,-Wmissing-declarations]
enum class { };
^~~~
error: scoped enumeration requires a name
enum class { x };
^
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/54216] Missing diagnostic for ill-formed anonymous enum declarations
2012-08-10 0:18 [Bug c++/54216] New: Missing diagnostic for ill-formed anonymous enum declarations frankhb1989 at gmail dot com
@ 2012-08-10 0:21 ` frankhb1989 at gmail dot com
2012-10-11 0:34 ` paolo.carlini at oracle dot com
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: frankhb1989 at gmail dot com @ 2012-08-10 0:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54216
frankhb1989 at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/54216] Missing diagnostic for ill-formed anonymous enum declarations
2012-08-10 0:18 [Bug c++/54216] New: Missing diagnostic for ill-formed anonymous enum declarations frankhb1989 at gmail dot com
2012-08-10 0:21 ` [Bug c++/54216] " frankhb1989 at gmail dot com
@ 2012-10-11 0:34 ` paolo.carlini at oracle dot com
2013-04-10 0:36 ` paolo.carlini at oracle dot com
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ 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=54216
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amylaar at gcc dot gnu.org
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-11 00:34:06 UTC ---
*** Bug 29018 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/54216] Missing diagnostic for ill-formed anonymous enum declarations
2012-08-10 0:18 [Bug c++/54216] New: Missing diagnostic for ill-formed anonymous enum declarations frankhb1989 at gmail dot com
2012-08-10 0:21 ` [Bug c++/54216] " frankhb1989 at gmail dot com
2012-10-11 0:34 ` paolo.carlini at oracle dot com
@ 2013-04-10 0:36 ` paolo.carlini at oracle dot com
2013-04-10 0:41 ` paolo.carlini at oracle dot com
2013-04-11 9:04 ` paolo.carlini at oracle dot com
4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-04-10 0:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54216
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2013-04-10
AssignedTo|unassigned at gcc dot |paolo.carlini at oracle dot
|gnu.org |com
Target Milestone|--- |4.9.0
Ever Confirmed|0 |1
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-04-10 00:36:11 UTC ---
Mine.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/54216] Missing diagnostic for ill-formed anonymous enum declarations
2012-08-10 0:18 [Bug c++/54216] New: Missing diagnostic for ill-formed anonymous enum declarations frankhb1989 at gmail dot com
` (2 preceding siblings ...)
2013-04-10 0:36 ` paolo.carlini at oracle dot com
@ 2013-04-10 0:41 ` paolo.carlini at oracle dot com
2013-04-11 9:04 ` paolo.carlini at oracle dot com
4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-04-10 0:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54216
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-04-10 00:41:06 UTC ---
Hi Jason. I'm working on this and the patch is trivial but I suspect that quite
a few testcases (in the library too) need adjusting. Thus, before I start to do
that, wanted to ask: is it Ok a pedwarn for the first case:
enum {}; //-std=c++98 or -std=c++11
and an hard error for the other two:
enum class {}; //-std=c++11
enum class { x }; //-std=c++11
? Like:
54216.C:1:6: warning: anonymous enumeration may not be empty [-Wpedantic]
enum {}; //-std=c++98 or -std=c++11
^
54216.C:3:12: error: scoped enumeration without a name
enum class {}; //-std=c++11
^
54216.C:5:12: error: scoped enumeration without a name
enum class { x }; //-std=c++11
^
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/54216] Missing diagnostic for ill-formed anonymous enum declarations
2012-08-10 0:18 [Bug c++/54216] New: Missing diagnostic for ill-formed anonymous enum declarations frankhb1989 at gmail dot com
` (3 preceding siblings ...)
2013-04-10 0:41 ` paolo.carlini at oracle dot com
@ 2013-04-11 9:04 ` paolo.carlini at oracle dot com
4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-04-11 9:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54216
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
CC|jason at gcc dot gnu.org |
Resolution| |FIXED
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-04-11 09:04:55 UTC ---
Fixed in r197742.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-04-11 9:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-10 0:18 [Bug c++/54216] New: Missing diagnostic for ill-formed anonymous enum declarations frankhb1989 at gmail dot com
2012-08-10 0:21 ` [Bug c++/54216] " frankhb1989 at gmail dot com
2012-10-11 0:34 ` paolo.carlini at oracle dot com
2013-04-10 0:36 ` paolo.carlini at oracle dot com
2013-04-10 0:41 ` paolo.carlini at oracle dot com
2013-04-11 9:04 ` paolo.carlini at oracle dot com
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).