This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/41060] Wconversion Ignores static_cast
- From: "redi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Aug 2009 09:51:29 -0000
- Subject: [Bug c++/41060] Wconversion Ignores static_cast
- References: <bug-41060-18063@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from redi at gcc dot gnu dot org 2009-08-14 09:51 -------
Do you have a testcase?
I tried this and static_cast behaves the same as the C-style cast:
int i1 = 0.5;
int i2 = (int)0.5;
int i3 = static_cast<int>(0.5);
Only the first line gives a warning.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41060