From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6602 invoked by alias); 1 Dec 2012 20:43:56 -0000 Received: (qmail 6553 invoked by uid 48); 1 Dec 2012 20:43:39 -0000 From: "pashev.igor at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55557] New: g++ 4.7 does not issue a warning on the first auto_ptr Date: Sat, 01 Dec 2012 20:43:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pashev.igor at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-12/txt/msg00047.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D55557 Bug #: 55557 Summary: g++ 4.7 does not issue a warning on the first auto_ptr Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: pashev.igor@gmail.com Here is a C++ source code: # cat -n test.cpp 1 #include 2 using namespace std; 3=20=20=20 4 int main(int argc, char **argv) 5 { 6 auto_ptr x; 7 auto_ptr y; 8 auto_ptr z; 9=20=20=20 10 return 0; 11 } Command line to compile it with C++11 standard: g++-4.7 -std=3Dgnu++11 -Wall -Wextra -Wdeprecated-declarations -pedantic test.cpp=20 Here is the g++ output: test.cpp: In function =E2=80=98int main(int, char**)=E2=80=99: test.cpp:7:19: warning: =E2=80=98auto_ptr=E2=80=99 is deprecated (declared = at /usr/include/c++/4.7/backward/auto_ptr.h:87) [-Wdeprecated-declarations] test.cpp:8:19: warning: =E2=80=98auto_ptr=E2=80=99 is deprecated (declared = at /usr/include/c++/4.7/backward/auto_ptr.h:87) [-Wdeprecated-declarations] test.cpp: At global scope: test.cpp:4:5: warning: unused parameter =E2=80=98argc=E2=80=99 [-Wunused-pa= rameter] test.cpp:4:5: warning: unused parameter =E2=80=98argv=E2=80=99 [-Wunused-pa= rameter] A warning about auto_ptr being deprecated has been issued only for y and z.= I expect a warning for x too. Moreover, if I leave only one auto_ptr (say, x) I will see no deprecation warning at all. It is expected to see warning on every auto_ptr instantiation.