From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3319 invoked by alias); 22 Dec 2010 09:18:08 -0000 Received: (qmail 3309 invoked by uid 22791); 22 Dec 2010 09:18:07 -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; Wed, 22 Dec 2010 09:18:03 +0000 From: "manu 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: manu 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: 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: Wed, 22 Dec 2010 09:18: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/msg02479.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D18016 --- Comment #10 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez 2010-12-22 09:17:42 UTC --- Like others commenting here, I don't understand why a(a) should not warn on= ly with -Winit-self. On the other hand, I always thought that Winit-self is a = bad idea. Although the patch does not fixes many cases and thus, we shouldn't c= lose this PR, it is better than nothing.=20 About the location, don't we have a better location at that point? I am thinking that X() : j(j), #2 i(i) #3 {} should give warnings in #2 and #3. Please, resubmit and ping. I think this is small enough to go in GCC 4.6.