From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5267 invoked by alias); 6 Jun 2007 09:44:18 -0000 Received: (qmail 5237 invoked by uid 48); 6 Jun 2007 09:44:08 -0000 Date: Wed, 06 Jun 2007 09:44:00 -0000 Message-ID: <20070606094408.5236.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/31960] Premature hiding of symbols makes a copy constructor shooting at its own foot In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "waldemar dot rachwal at gmail dot com" 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: 2007-06/txt/msg00372.txt.bz2 ------- Comment #3 from waldemar dot rachwal at gmail dot com 2007-06-06 09:44 ------- [3 weeks went by, but i've not forgotten about my bug report ;] as about the last comment (#2) I can't fully agree. -Winit-self works, but only in case of builtin scalar data types. For objects the compiler is almost quiet. Please don't misunderstand me: I don't really want any options to signal a warning on self-initializers (more options, much headache). I really expect well defined, desirable semantics for such constructs because there are cases they are very helpful. Of course, if the current standard says nothing about this or leave up to implementors, and we want to have G++ semantics here defined, there is a room for some options in the meantime until the standard becomes definite. Please note that scripting languages are well defined here. Below is a simple Perl code (strictness checks if vars are defined, while -w option add extra warning level). Regards, WR. $ perl -Mstrict -e 'my $z = 1; my $z = $z + 1; print "$z\n"' 2 $ perl -w -Mstrict -e 'my $z = 1; my $z = $z + 1; print "$z\n"' "my" variable $z masks earlier declaration in same scope at -e line 1. 2 -- waldemar dot rachwal at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |waldemar dot rachwal at | |gmail dot com Status|RESOLVED |UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31960