[Bug c++/21310] New: warning: '<anonymous>' may be used uninitialized in this function
wanderer at rsu dot ru
gcc-bugzilla@gcc.gnu.org
Sat Apr 30 22:15:00 GMT 2005
Current mainline GCC generate strage warnings with -O -Wuninitialized options
if compile testcase:
--8X---------------------------------
#include<map>
struct W {
static int g(int v) { return std::min(v,0); }
};
struct R {
R();
R(int v);
int m;
};
int main() {
std::map<int,R> e;
e[0] = R(W::g(0));
}
--X8------------------------------
Output:
test.cc: In function 'int main()':
test.cc:4: warning: '<anonymous>' may be used uninitialized in this function
test.cc:15: warning: 'v' may be used uninitialized in this function
GCC 4.0.0 compile with same options without warnings.
Vladimir
--
Summary: warning: '<anonymous>' may be used uninitialized in this
function
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: wanderer at rsu dot ru
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i386-unknown-freebsd5.3
GCC host triplet: i386-unknown-freebsd5.3
GCC target triplet: i386-unknown-freebsd5.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21310
More information about the Gcc-bugs
mailing list