public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11677] New: Incorrect warning with -Wunused-value
@ 2003-07-26 23:21 weiss at sztaki dot hu
  2003-07-26 23:26 ` [Bug c++/11677] " pinskia at physics dot uc dot edu
  0 siblings, 1 reply; 2+ messages in thread
From: weiss at sztaki dot hu @ 2003-07-26 23:21 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=11677

           Summary: Incorrect warning with -Wunused-value
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: weiss at sztaki dot hu
                CC: gcc-bugs at gcc dot gnu dot org

The following code issues an incorrect warning.
Note, that the non-template version (fine) is fine.

gonzo:/tmp # cat foo.cc
template <class T>
void foo(T &a)
{
  for(int i = 0, j = 0; i != 3; ++i, ++j)
    a += j;
}

void fine(int &a)
{
  for(int i = 0, j = 0; i != 3; ++i, ++j)
    a += j;
}

int
main()
{
  return 0;
}

gonzo:/tmp # /gml/shared/gcc-cvs/bin/g++ -v
Reading specs from /gml/shared/gcc-cvs/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs
Konfiguriert mit: ../gcc/configure --prefix=/gml/shared/gcc-cvs --enable-shared
--enable-languages=c,c++ --enable-threads=posix
Thread model: posix
gcc-Version 3.4 20030726 (experimental)

gonzo:/tmp # /gml/shared/gcc-cvs/bin/g++ -Wunused-value foo.cc
foo.cc: In function `void foo(T&)':
foo.cc:4: Warnung: left-hand operand of comma expression has no effect


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

* [Bug c++/11677] Incorrect warning with -Wunused-value
  2003-07-26 23:21 [Bug c++/11677] New: Incorrect warning with -Wunused-value weiss at sztaki dot hu
@ 2003-07-26 23:26 ` pinskia at physics dot uc dot edu
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-26 23:26 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=11677


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-26 23:26 -------
This bug is a dup of bug 11512 (which almost have the exact source).

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


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

end of thread, other threads:[~2003-07-26 23:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-26 23:21 [Bug c++/11677] New: Incorrect warning with -Wunused-value weiss at sztaki dot hu
2003-07-26 23:26 ` [Bug c++/11677] " 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).