public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/23689] New: Malformed typedef silently ignored
@ 2005-09-01 23:51 simon_baldwin at yahoo dot com
  2005-09-02 13:02 ` [Bug c++/23689] " falk at debian dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: simon_baldwin at yahoo dot com @ 2005-09-01 23:51 UTC (permalink / raw)
  To: gcc-bugs

Given the program

  typedef enum { ZERO };   // error, malformed typedef, missing identifier
  typedef struct dummy {}; // ditto

gcc will silently step over and apparently ignore the typedef, treating the
statement as a simple "enum { ZERO };" rather than a "typedef enum { ZERO }
type_name;" where type_name has been accidentally omitted.

Grammatically, perhaps correct.  However, a warning or error message here would
be handy.

-- 
           Summary: Malformed typedef silently ignored
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: simon_baldwin at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/23689] Malformed typedef silently ignored
  2005-09-01 23:51 [Bug c++/23689] New: Malformed typedef silently ignored simon_baldwin at yahoo dot com
@ 2005-09-02 13:02 ` falk at debian dot org
  2005-09-02 13:25   ` Gabriel Dos Reis
  2005-09-02 13:25 ` gdr at integrable-solutions dot net
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: falk at debian dot org @ 2005-09-02 13:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From falk at debian dot org  2005-09-02 13:02 -------
Works for me with any gcc version:

falk@juist:/tmp% gcc-3.4 -c test.c 
test.c:1: warning: useless keyword or type name in empty declaration
test.c:2: warning: useless keyword or type name in empty declaration

What is the exact version you are using and the exact flags you are passing?


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug c++/23689] Malformed typedef silently ignored
  2005-09-01 23:51 [Bug c++/23689] New: Malformed typedef silently ignored simon_baldwin at yahoo dot com
  2005-09-02 13:02 ` [Bug c++/23689] " falk at debian dot org
@ 2005-09-02 13:25 ` gdr at integrable-solutions dot net
  2005-09-02 19:12 ` simon_baldwin at yahoo dot com
  2005-09-02 19:19 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 11+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-09-02 13:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2005-09-02 13:25 -------
Subject: Re:  Malformed typedef silently ignored

"falk at debian dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| Works for me with any gcc version:
| 
| falk@juist:/tmp% gcc-3.4 -c test.c 
| test.c:1: warning: useless keyword or type name in empty declaration
| test.c:2: warning: useless keyword or type name in empty declaration
| 
| What is the exact version you are using and the exact flags you are passing?

The bug was reported against C++; I believe you're testing with a C
compiler, instead of C++.

-- Gaby


-- 


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


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

* Re: [Bug c++/23689] Malformed typedef silently ignored
  2005-09-02 13:02 ` [Bug c++/23689] " falk at debian dot org
@ 2005-09-02 13:25   ` Gabriel Dos Reis
  0 siblings, 0 replies; 11+ messages in thread
From: Gabriel Dos Reis @ 2005-09-02 13:25 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs

"falk at debian dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| Works for me with any gcc version:
| 
| falk@juist:/tmp% gcc-3.4 -c test.c 
| test.c:1: warning: useless keyword or type name in empty declaration
| test.c:2: warning: useless keyword or type name in empty declaration
| 
| What is the exact version you are using and the exact flags you are passing?

The bug was reported against C++; I believe you're testing with a C
compiler, instead of C++.

-- Gaby


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

* [Bug c++/23689] Malformed typedef silently ignored
  2005-09-01 23:51 [Bug c++/23689] New: Malformed typedef silently ignored simon_baldwin at yahoo dot com
  2005-09-02 13:02 ` [Bug c++/23689] " falk at debian dot org
  2005-09-02 13:25 ` gdr at integrable-solutions dot net
@ 2005-09-02 19:12 ` simon_baldwin at yahoo dot com
  2005-09-02 19:19 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 11+ messages in thread
From: simon_baldwin at yahoo dot com @ 2005-09-02 19:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From simon_baldwin at yahoo dot com  2005-09-02 19:12 -------
The problem's restricted to the C++ front end only, and is common across
multiple releases and at the highest warning settings:

$ cat e.cc
typedef enum { ZERO };   // error, malformed typedef, missing identifier
typedef struct dummy {}; // ditto

$ g++-4.1 -Wall -W -pedantic -c e.cc
$ g++-4.0.1-k8 -Wall -W -pedantic -c e.cc
$ g++-3.4.1 -Wall -W -pedantic -c e.cc
$ g++-3.2.2 -Wall -W -pedantic -c e.cc
$ g++-2.95 -Wall -W -pedantic -c e.c


-- 


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


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

* [Bug c++/23689] Malformed typedef silently ignored
  2005-09-01 23:51 [Bug c++/23689] New: Malformed typedef silently ignored simon_baldwin at yahoo dot com
                   ` (2 preceding siblings ...)
  2005-09-02 19:12 ` simon_baldwin at yahoo dot com
@ 2005-09-02 19:19 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-02 19:19 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-09-02 19:19:17
               date|                            |


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


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

* [Bug c++/23689] Malformed typedef silently ignored
       [not found] <bug-23689-11271@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2007-03-01 19:16 ` ian at gcc dot gnu dot org
@ 2007-06-25 17:26 ` simon_baldwin at yahoo dot com
  4 siblings, 0 replies; 11+ messages in thread
From: simon_baldwin at yahoo dot com @ 2007-06-25 17:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from simon_baldwin at yahoo dot com  2007-06-25 17:26 -------
Resolved by revision 122434.


-- 

simon_baldwin at yahoo dot com changed:

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


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


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

* [Bug c++/23689] Malformed typedef silently ignored
       [not found] <bug-23689-11271@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2007-02-16 17:17 ` patchapp at dberlin dot org
@ 2007-03-01 19:16 ` ian at gcc dot gnu dot org
  2007-06-25 17:26 ` simon_baldwin at yahoo dot com
  4 siblings, 0 replies; 11+ messages in thread
From: ian at gcc dot gnu dot org @ 2007-03-01 19:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from ian at gcc dot gnu dot org  2007-03-01 19:13 -------
Subject: Bug 23689

Author: ian
Date: Thu Mar  1 19:13:02 2007
New Revision: 122434

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122434
Log:
cp/:
        PR c++/23689
        * decl.c (check_tag_decl): Added new warning for typedef ignored
        when it precedes an otherwise valid non-typedef declaration.
testsuite/:
        PR c++/23689
        * warn/ignored_typedef.C: New.
        * init/ctor8.C: Added dg-warning to consume ignored typedef
        warning. 
        * template/typedef2.C: Ditto.  Moved dg-error onto its own line
        and added an explicit line number.

Added:
    trunk/gcc/testsuite/g++.dg/warn/ignored_typedef.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/init/ctor8.C
    trunk/gcc/testsuite/g++.dg/template/typedef2.C


-- 


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


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

* [Bug c++/23689] Malformed typedef silently ignored
       [not found] <bug-23689-11271@http.gcc.gnu.org/bugzilla/>
  2006-03-05  3:19 ` pinskia at gcc dot gnu dot org
  2007-02-09 12:45 ` manu at gcc dot gnu dot org
@ 2007-02-16 17:17 ` patchapp at dberlin dot org
  2007-03-01 19:16 ` ian at gcc dot gnu dot org
  2007-06-25 17:26 ` simon_baldwin at yahoo dot com
  4 siblings, 0 replies; 11+ messages in thread
From: patchapp at dberlin dot org @ 2007-02-16 17:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from patchapp at dberlin dot org  2007-02-16 17:17 -------
Subject: Bug number PR c++/23689

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-02/msg00114.html


-- 


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


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

* [Bug c++/23689] Malformed typedef silently ignored
       [not found] <bug-23689-11271@http.gcc.gnu.org/bugzilla/>
  2006-03-05  3:19 ` pinskia at gcc dot gnu dot org
@ 2007-02-09 12:45 ` manu at gcc dot gnu dot org
  2007-02-16 17:17 ` patchapp at dberlin dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-02-09 12:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from manu at gcc dot gnu dot org  2007-02-09 12:44 -------
Someone posted a patch. It is not in the patch queue, so I mention it here
before it gets lost:
http://gcc.gnu.org/ml/gcc-patches/2007-02/msg00114.html


-- 


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


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

* [Bug c++/23689] Malformed typedef silently ignored
       [not found] <bug-23689-11271@http.gcc.gnu.org/bugzilla/>
@ 2006-03-05  3:19 ` pinskia at gcc dot gnu dot org
  2007-02-09 12:45 ` manu at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-05  3:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-03-05 03:19 -------
I have also seen this while reducing sources using delta.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
           Severity|enhancement                 |minor
   Last reconfirmed|2005-09-02 19:19:17         |2006-03-05 03:19:00
               date|                            |


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


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

end of thread, other threads:[~2007-06-25 17:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-01 23:51 [Bug c++/23689] New: Malformed typedef silently ignored simon_baldwin at yahoo dot com
2005-09-02 13:02 ` [Bug c++/23689] " falk at debian dot org
2005-09-02 13:25   ` Gabriel Dos Reis
2005-09-02 13:25 ` gdr at integrable-solutions dot net
2005-09-02 19:12 ` simon_baldwin at yahoo dot com
2005-09-02 19:19 ` pinskia at gcc dot gnu dot org
     [not found] <bug-23689-11271@http.gcc.gnu.org/bugzilla/>
2006-03-05  3:19 ` pinskia at gcc dot gnu dot org
2007-02-09 12:45 ` manu at gcc dot gnu dot org
2007-02-16 17:17 ` patchapp at dberlin dot org
2007-03-01 19:16 ` ian at gcc dot gnu dot org
2007-06-25 17:26 ` simon_baldwin at yahoo 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).