public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/5520] Add a warning to detect empty body of if statements (like in the C frontend)
       [not found] <bug-5520-2906@http.gcc.gnu.org/bugzilla/>
@ 2006-01-05 10:19 ` mueller at kde dot org
  2006-01-05 10:36 ` falk at debian dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mueller at kde dot org @ 2006-01-05 10:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from mueller at kde dot org  2006-01-05 10:19 -------
http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01627.html


-- 

mueller at kde dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mueller at kde dot org


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



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

* [Bug c++/5520] Add a warning to detect empty body of if statements (like in the C frontend)
       [not found] <bug-5520-2906@http.gcc.gnu.org/bugzilla/>
  2006-01-05 10:19 ` [Bug c++/5520] Add a warning to detect empty body of if statements (like in the C frontend) mueller at kde dot org
@ 2006-01-05 10:36 ` falk at debian dot org
  2006-01-05 11:22 ` nathan at codesourcery dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: falk at debian dot org @ 2006-01-05 10:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from falk at debian dot org  2006-01-05 10:36 -------
*** Bug 19773 has been marked as a duplicate of this bug. ***


-- 

falk at debian dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |austern at apple dot com


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



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

* [Bug c++/5520] Add a warning to detect empty body of if statements (like in the C frontend)
       [not found] <bug-5520-2906@http.gcc.gnu.org/bugzilla/>
  2006-01-05 10:19 ` [Bug c++/5520] Add a warning to detect empty body of if statements (like in the C frontend) mueller at kde dot org
  2006-01-05 10:36 ` falk at debian dot org
@ 2006-01-05 11:22 ` nathan at codesourcery dot com
  2006-01-08 21:59 ` mueller at kde dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: nathan at codesourcery dot com @ 2006-01-05 11:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from nathan at codesourcery dot com  2006-01-05 11:22 -------
Subject: Re:  Add a warning to detect empty body of if statements
 (like in the C frontend)

mueller at kde dot org wrote:
> ------- Comment #5 from mueller at kde dot org  2006-01-05 10:19 -------
> http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01627.html

Could cp_parser_implicitly_scoped_statement be flattened to use 
cp_lexer_next_token_is, rather than CLNTI_not?  that'd read better.  I'd
suggest
  if(cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
    .. handle {...}
  else if (cp_lexer_next_token_is (parser->lexer (CPP_SEMICOLON))
    .. handle empty
  else
    .. handle implicitly scoped stmt

The C++ changes will be ok with that change.  Someone else will need to approve 
the C change (but it looks ok to me)

nathan


-- 


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



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

* [Bug c++/5520] Add a warning to detect empty body of if statements (like in the C frontend)
       [not found] <bug-5520-2906@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2006-01-05 11:22 ` nathan at codesourcery dot com
@ 2006-01-08 21:59 ` mueller at kde dot org
  2006-01-20  9:30 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mueller at kde dot org @ 2006-01-08 21:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from mueller at kde dot org  2006-01-08 21:59 -------
Created an attachment (id=10596)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10596&action=view)
updated patch

I agree, that makes it much more readable. updated accordingly and rediffed
against current trunk. bootstrapped, regtested successfully. 


-- 


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



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

* [Bug c++/5520] Add a warning to detect empty body of if statements (like in the C frontend)
       [not found] <bug-5520-2906@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2006-01-08 21:59 ` mueller at kde dot org
@ 2006-01-20  9:30 ` rguenth at gcc dot gnu dot org
  2006-01-20 10:11 ` rguenth at gcc dot gnu dot org
  2006-09-08 23:29 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-01-20  9:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from rguenth at gcc dot gnu dot org  2006-01-20 09:30 -------
Subject: Bug 5520

Author: rguenth
Date: Fri Jan 20 09:30:22 2006
New Revision: 110019

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110019
Log:
2006-01-20  Dirk Mueller  <dmueller@suse.com>

        PR c++/5520
        * c-parser.c (c_parser_if_body): Use build_empty_stmt()
        instead of a special NOP marker.
        * c-typeck.c (c_finish_if_stmt): Remove obsoleted special
        NOP marker handling.
        * c-common.h (empty_body_warning): Add forward declaration.
        * c-common.c (empty_body_warning): Add (from c_finish_if_stmt).
        Now uses IS_EMPTY_STMT() instead of special NOP markers.

        * semantics.c (finish_if_stmt): Call empty_body_warning.
        * parser.c (cp_parser_implicitly_scoped_statement):
        Mark empty statement with an empty stmt.

        * g++.dg/warn/empty-body.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/warn/empty-body.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-common.c
    trunk/gcc/c-common.h
    trunk/gcc/c-parser.c
    trunk/gcc/c-typeck.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/5520] Add a warning to detect empty body of if statements (like in the C frontend)
       [not found] <bug-5520-2906@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2006-01-20  9:30 ` rguenth at gcc dot gnu dot org
@ 2006-01-20 10:11 ` rguenth at gcc dot gnu dot org
  2006-09-08 23:29 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-01-20 10:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from rguenth at gcc dot gnu dot org  2006-01-20 10:11 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.2.0


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


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

* [Bug c++/5520] Add a warning to detect empty body of if statements (like in the C frontend)
       [not found] <bug-5520-2906@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2006-01-20 10:11 ` rguenth at gcc dot gnu dot org
@ 2006-09-08 23:29 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-08 23:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from pinskia at gcc dot gnu dot org  2006-09-08 23:28 -------
*** Bug 28992 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simon_baldwin at yahoo dot
                   |                            |com


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


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

* [Bug c++/5520] Add a warning to detect empty body of if statements (like in the C frontend)
       [not found] <20020128154601.5520.jbach1@caramail.com>
@ 2003-08-04  0:41 ` pinskia at physics dot uc dot edu
  0 siblings, 0 replies; 8+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-08-04  0:41 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4                         |---


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

end of thread, other threads:[~2006-09-08 23:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-5520-2906@http.gcc.gnu.org/bugzilla/>
2006-01-05 10:19 ` [Bug c++/5520] Add a warning to detect empty body of if statements (like in the C frontend) mueller at kde dot org
2006-01-05 10:36 ` falk at debian dot org
2006-01-05 11:22 ` nathan at codesourcery dot com
2006-01-08 21:59 ` mueller at kde dot org
2006-01-20  9:30 ` rguenth at gcc dot gnu dot org
2006-01-20 10:11 ` rguenth at gcc dot gnu dot org
2006-09-08 23:29 ` pinskia at gcc dot gnu dot org
     [not found] <20020128154601.5520.jbach1@caramail.com>
2003-08-04  0:41 ` pinskia at physics dot uc dot edu

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