This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48829] g++ no warning initializing a variable using itself
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 30 Apr 2011 19:52:30 +0000
- Subject: [Bug c++/48829] g++ no warning initializing a variable using itself
- Auto-submitted: auto-generated
- References: <bug-48829-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48829
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-04-30 19:52:08 UTC ---
The string case calls a function (the overloaded operator+ or std::string) so
is actually closer to:
int f(int);
int i = f(i);
which doesn't warn either (although it should do, ideally)
This is similar to PR 48483, maybe even a dup.