[Bug c++/31960] Premature hiding of symbols makes a copy constructor shooting at its own foot
waldemar dot rachwal at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Jun 6 09:44:00 GMT 2007
------- 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
More information about the Gcc-bugs
mailing list