Bug 11849 - cast mistaken as declaration
Summary: cast mistaken as declaration
Status: RESOLVED DUPLICATE of bug 11796
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.2.2
: P2 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2003-08-07 21:25 UTC by Jim Wilson
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Wilson 2003-08-07 21:25:18 UTC
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'
Comment 1 Andrew Pinski 2003-08-07 21:58:15 UTC
This is already fixed on the mainline and will not be fixed for 3.3.x because the bison based parser 
cannot handle this.  
Also read <http://gcc.gnu.org/bugs.html#parsing> as this is known bug that was fixed by having 
a hand made parser for c++ which will not be back ported to 3.3.x.
Comment 2 Andrew Pinski 2004-04-21 01:29:32 UTC
Reopening to mark as a dup of ....
Comment 3 Andrew Pinski 2004-04-21 01:29:51 UTC
bug 11796.

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