public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/64383] New: missed warning for unused variable.
@ 2014-12-23 12:40 pluto at agmk dot net
  2014-12-23 20:44 ` [Bug c++/64383] " manu at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: pluto at agmk dot net @ 2014-12-23 12:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64383

            Bug ID: 64383
           Summary: missed warning for unused variable.
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pluto at agmk dot net

#include <memory>
#include <vector>

int main()
{
    std::vector< std::shared_ptr< int > > v1;
    v1.push_back( std::make_shared< int >( 7 ) );
    for( auto p : v1 )
    {
    }
    std::vector< int > v2;
    v2.push_back( 7 );
    for( auto i : v2 )
    {
    }
}


the 'p' variable is not reported as unused.


% LANG=C g++ -Wall -g2 t.cpp -o t -std=c++1y
t.cpp: In function 'int main()':
t.cpp:13:15: warning: unused variable 'i' [-Wunused-variable]
     for( auto i : v2 )
               ^


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

end of thread, other threads:[~2015-01-20 14:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-23 12:40 [Bug c++/64383] New: missed warning for unused variable pluto at agmk dot net
2014-12-23 20:44 ` [Bug c++/64383] " manu at gcc dot gnu.org
2015-01-12 12:02 ` pluto at agmk dot net
2015-01-20 11:55 ` jakub at gcc dot gnu.org
2015-01-20 13:51 ` paolo.carlini at oracle dot com
2015-01-20 14:20 ` paolo at gcc dot gnu.org
2015-01-20 14:21 ` 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).