This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11849] New: cast mistaken as declaration


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'


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]