[Bug c++/40695] bogus "may be used uninitialized in this function" warning
shane dot beasley at aleri dot com
gcc-bugzilla@gcc.gnu.org
Fri Jul 10 04:38:00 GMT 2009
------- Comment #3 from shane dot beasley at aleri dot com 2009-07-10 04:37 -------
Another test case (should I file another bug?):
<blockquote>
struct Class
{
Class() { }
/* implicit copy constructor */
void Method() const; // undefined
/* Class has no data members */
};
void f(); // undefined
void g( Class x ) // pass by value
{
f(); // call undefined function
x.Method(); // call method on parameter
}
void h()
{
Class x;
g( x );
}
<blockquote>
$ g++ -Wuninitialized -O3 -c -o /dev/null file.cpp
file.cpp: In function 'void h()':
file.cpp:20: warning: '<anonymous>' is used uninitialized in this function
$ g++ -dumpversion
4.4.0
BTW: I'm just now trying to build our stuff with GCC 4.4.0. I've run into two
warnings. The first is comment 0. The second may or may not be similar to the
above, except that it has data members -- but still no copy constructor or
assignment operator (no need). For fun, I've added them and am rebuilding now.
If that doesn't fix the problem, I'll probably be back later. :)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40695
More information about the Gcc-bugs
mailing list