Bug 21310 - warning: '<anonymous>' may be used uninitialized in this function
Summary: warning: '<anonymous>' may be used uninitialized in this function
Status: RESOLVED DUPLICATE of bug 21124
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-30 22:15 UTC by wanderer
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: i386-unknown-freebsd5.3
Target: i386-unknown-freebsd5.3
Build: i386-unknown-freebsd5.3
Known to work:
Known to fail:
Last reconfirmed:


Attachments
.ii file (28.20 KB, text/plain)
2005-04-30 22:16 UTC, wanderer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wanderer 2005-04-30 22:15:44 UTC
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
Comment 1 wanderer 2005-04-30 22:16:23 UTC
Created attachment 8778 [details]
.ii file
Comment 2 Andrew Pinski 2005-04-30 23:38:20 UTC

*** This bug has been marked as a duplicate of 21124 ***