This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11849] New: cast mistaken as declaration
- From: "wilson at afn dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Aug 2003 21:25:21 -0000
- Subject: [Bug c++/11849] New: cast mistaken as declaration
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11849
Summary: cast mistaken as declaration
Product: gcc
Version: 3.2.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: wilson at afn dot org
CC: gcc-bugs at gcc dot gnu dot org
Source (3 lines, bug.cxx):
double rint(double); // Example illustrates utility
unsigned foo((unsigned)rint(3.2)); // This less desirable form works
unsigned bar(unsigned(rint(3.2))); // This equivalent doesn't
G++ whines:
bug.cxx:3: `unsigned int rint' redeclared as different kind of symbol
bug.cxx:1: previous declaration of `double rint(double)'
bug.cxx:3: warning: initialization to `unsigned int' from `double'
bug.cxx:3: warning: argument to `unsigned int' from `double'