From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5567 invoked by alias); 21 Dec 2010 15:28:30 -0000 Received: (qmail 5557 invoked by uid 22791); 21 Dec 2010 15:28:29 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Dec 2010 15:28:26 +0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/18016] Warn about member variables initialized with itself X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: diagnostic, patch X-Bugzilla-Severity: enhancement X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Keywords Message-ID: In-Reply-To: References: 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 Date: Tue, 21 Dec 2010 15:28:00 -0000 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: 2010-12/txt/msg02438.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D18016 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch --- Comment #8 from Jonathan Wakely 2010-12-21 15= :28:18 UTC --- With the patch at http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01622.html the testcase above gives: $ g++4x a.cc -c -Wuninitialized a.cc: In constructor =E2=80=98A::A()=E2=80=99: a.cc:4:5: warning: =E2=80=98A::a=E2=80=99 is initialized with itself [-Wuni= nitialized] a.cc: In member function =E2=80=98int A::getA()=E2=80=99: a.cc:9:10: warning: =E2=80=98b=E2=80=99 is used uninitialized in this funct= ion [-Wuninitialized]