public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/27371]  New: [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result)))
@ 2006-05-01 15:41 rguenth at gcc dot gnu dot org
  2006-05-02 15:35 ` [Bug c++/27371] " pinskia at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-01 15:41 UTC (permalink / raw)
  To: gcc-bugs

class QByteArray {
public:
  QByteArray(const QByteArray &);
};
class QString {
  QByteArray toLocal8Bit() const __attribute__ ((warn_unused_result));
  void fooWarnHere() const { toLocal8Bit(); }
};

Does not complain about fooWarnHere().  4.0.3 did this.


-- 
           Summary: [4.1/4.2 Regression] Does not warn about unused function
                    result (__attribute__((warn_unused_result)))
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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


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

* [Bug c++/27371] [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result)))
  2006-05-01 15:41 [Bug c++/27371] New: [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result))) rguenth at gcc dot gnu dot org
@ 2006-05-02 15:35 ` pinskia at gcc dot gnu dot org
  2006-05-04 14:47 ` rguenth at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-02 15:35 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.1


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


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

* [Bug c++/27371] [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result)))
  2006-05-01 15:41 [Bug c++/27371] New: [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result))) rguenth at gcc dot gnu dot org
  2006-05-02 15:35 ` [Bug c++/27371] " pinskia at gcc dot gnu dot org
@ 2006-05-04 14:47 ` rguenth at gcc dot gnu dot org
  2006-05-14 22:32 ` mmitchel at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-04 14:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2006-05-04 14:47 -------
Confirmed.  The problem is that the C++ frontend emits

 unused_tmp = toLocal8Bit();

for the call.  At least it has DECL_IGNORED set, so maybe I have a patch for
this.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-05-04 14:47:45
               date|                            |


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


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

* [Bug c++/27371] [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result)))
  2006-05-01 15:41 [Bug c++/27371] New: [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result))) rguenth at gcc dot gnu dot org
  2006-05-02 15:35 ` [Bug c++/27371] " pinskia at gcc dot gnu dot org
  2006-05-04 14:47 ` rguenth at gcc dot gnu dot org
@ 2006-05-14 22:32 ` mmitchel at gcc dot gnu dot org
  2006-05-25  2:40 ` mmitchel at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-05-14 22:32 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug c++/27371] [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result)))
  2006-05-01 15:41 [Bug c++/27371] New: [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result))) rguenth at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-05-14 22:32 ` mmitchel at gcc dot gnu dot org
@ 2006-05-25  2:40 ` mmitchel at gcc dot gnu dot org
  2006-09-06  5:49 ` jason at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-05-25  2:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from mmitchel at gcc dot gnu dot org  2006-05-25 02:34 -------
Will not be fixed in 4.1.1; adjust target milestone to 4.1.2.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.1                       |4.1.2


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


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

* [Bug c++/27371] [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result)))
  2006-05-01 15:41 [Bug c++/27371] New: [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result))) rguenth at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-05-25  2:40 ` mmitchel at gcc dot gnu dot org
@ 2006-09-06  5:49 ` jason at gcc dot gnu dot org
  2006-09-06  5:59 ` jason at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-09-06  5:49 UTC (permalink / raw)
  To: gcc-bugs



-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jason at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-05-04 14:47:45         |2006-09-06 05:49:06
               date|                            |


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


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

* [Bug c++/27371] [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result)))
  2006-05-01 15:41 [Bug c++/27371] New: [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result))) rguenth at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-09-06  5:49 ` jason at gcc dot gnu dot org
@ 2006-09-06  5:59 ` jason at gcc dot gnu dot org
  2006-09-06 18:47 ` jason at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-09-06  5:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jason at gcc dot gnu dot org  2006-09-06 05:59 -------
This worked in 4.0 by accident, because of the NRV implementation I had in that
release which pushed aggregate return values into the argument list of a call. 
This had some problems, so I later changed it to use a MODIFY_EXPR, which
properly expresses what's going on, but interferes with this warning.


-- 


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


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

* [Bug c++/27371] [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result)))
  2006-05-01 15:41 [Bug c++/27371] New: [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result))) rguenth at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2006-09-06  5:59 ` jason at gcc dot gnu dot org
@ 2006-09-06 18:47 ` jason at gcc dot gnu dot org
  2006-09-07  1:13 ` jason at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-09-06 18:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jason at gcc dot gnu dot org  2006-09-06 18:47 -------
This is also complicated by PR 16269; we don't manage the lifetime of
temporaries, so we don't know whether an initialized temporary is used again.


-- 


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


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

* [Bug c++/27371] [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result)))
  2006-05-01 15:41 [Bug c++/27371] New: [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result))) rguenth at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2006-09-06 18:47 ` jason at gcc dot gnu dot org
@ 2006-09-07  1:13 ` jason at gcc dot gnu dot org
  2006-09-07 21:10 ` [Bug c++/27371] [4.1 " hjl at lucon dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-09-07  1:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jason at gcc dot gnu dot org  2006-09-07 01:13 -------
Subject: Bug 27371

Author: jason
Date: Thu Sep  7 01:12:00 2006
New Revision: 116737

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116737
Log:
        PR c++/27371
        * tree-inline.c (copy_result_decl_to_var): New fn.
        (declare_return_variable): Use it.  Call declare_inline_vars here.
        (expand_call_inline): Not here.
        * cp/cvt.c (convert_to_void): Strip useless TARGET_EXPR.
        * cp/cp-tree.h (TARGET_EXPR_IMPLICIT_P): New macro.
        * cp/tree.c (build_cplus_new): Set it.

Added:
    trunk/gcc/testsuite/g++.dg/warn/unused-result1.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/cvt.c
    trunk/gcc/cp/tree.c
    trunk/gcc/tree-inline.c


-- 


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


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

* [Bug c++/27371] [4.1 Regression] Does not warn about unused function result (__attribute__((warn_unused_result)))
  2006-05-01 15:41 [Bug c++/27371] New: [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result))) rguenth at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2006-09-07  1:13 ` jason at gcc dot gnu dot org
@ 2006-09-07 21:10 ` hjl at lucon dot org
  2006-09-07 22:47 ` jason at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hjl at lucon dot org @ 2006-09-07 21:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from hjl at lucon dot org  2006-09-07 21:10 -------
FWIW, g++.dg/warn/unused-result1.C fails:

http://gcc.gnu.org/ml/gcc-testresults/2006-09/msg00338.html


-- 


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


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

* [Bug c++/27371] [4.1 Regression] Does not warn about unused function result (__attribute__((warn_unused_result)))
  2006-05-01 15:41 [Bug c++/27371] New: [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result))) rguenth at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2006-09-07 21:10 ` [Bug c++/27371] [4.1 " hjl at lucon dot org
@ 2006-09-07 22:47 ` jason at gcc dot gnu dot org
  2006-09-07 22:51 ` jason at redhat dot com
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-09-07 22:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jason at gcc dot gnu dot org  2006-09-07 22:47 -------
Subject: Bug 27371

Author: jason
Date: Thu Sep  7 22:47:34 2006
New Revision: 116765

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116765
Log:
        PR c++/27371
        * cvt.c (convert_to_void): Enable previous change.

Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cvt.c


-- 


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


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

* [Bug c++/27371] [4.1 Regression] Does not warn about unused function result (__attribute__((warn_unused_result)))
  2006-05-01 15:41 [Bug c++/27371] New: [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result))) rguenth at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2006-09-07 22:47 ` jason at gcc dot gnu dot org
@ 2006-09-07 22:51 ` jason at redhat dot com
  2006-09-07 23:07 ` jason at gcc dot gnu dot org
  2006-09-08  7:40 ` rguenth at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: jason at redhat dot com @ 2006-09-07 22:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jason at redhat dot com  2006-09-07 22:50 -------
Subject: Re:  [4.1 Regression] Does not warn about unused function
 result (__attribute__((warn_unused_result)))

Whoops, I checked the patch in disabled.  Fixed.


-- 


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


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

* [Bug c++/27371] [4.1 Regression] Does not warn about unused function result (__attribute__((warn_unused_result)))
  2006-05-01 15:41 [Bug c++/27371] New: [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result))) rguenth at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2006-09-07 22:51 ` jason at redhat dot com
@ 2006-09-07 23:07 ` jason at gcc dot gnu dot org
  2006-09-08  7:40 ` rguenth at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-09-07 23:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jason at gcc dot gnu dot org  2006-09-07 23:07 -------
I don't think this patch is safe enough to backport to 4.1.  Closing.


-- 

jason at gcc dot gnu dot org changed:

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


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


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

* [Bug c++/27371] [4.1 Regression] Does not warn about unused function result (__attribute__((warn_unused_result)))
  2006-05-01 15:41 [Bug c++/27371] New: [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result))) rguenth at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2006-09-07 23:07 ` jason at gcc dot gnu dot org
@ 2006-09-08  7:40 ` rguenth at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-09-08  7:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from rguenth at gcc dot gnu dot org  2006-09-08 07:40 -------
Only fixed on the mainline.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.2                       |4.2.0


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


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

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

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-01 15:41 [Bug c++/27371] New: [4.1/4.2 Regression] Does not warn about unused function result (__attribute__((warn_unused_result))) rguenth at gcc dot gnu dot org
2006-05-02 15:35 ` [Bug c++/27371] " pinskia at gcc dot gnu dot org
2006-05-04 14:47 ` rguenth at gcc dot gnu dot org
2006-05-14 22:32 ` mmitchel at gcc dot gnu dot org
2006-05-25  2:40 ` mmitchel at gcc dot gnu dot org
2006-09-06  5:49 ` jason at gcc dot gnu dot org
2006-09-06  5:59 ` jason at gcc dot gnu dot org
2006-09-06 18:47 ` jason at gcc dot gnu dot org
2006-09-07  1:13 ` jason at gcc dot gnu dot org
2006-09-07 21:10 ` [Bug c++/27371] [4.1 " hjl at lucon dot org
2006-09-07 22:47 ` jason at gcc dot gnu dot org
2006-09-07 22:51 ` jason at redhat dot com
2006-09-07 23:07 ` jason at gcc dot gnu dot org
2006-09-08  7:40 ` 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).