This is the mail archive of the gcc@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]

Re: g++4.0 diagnostic on casting a static const member initializerto a double


Jonathan Wakely wrote:

*but* this is allowed, even with -pedantic and -pedantic-errors:

  struct S
  {
    static const int scd = 24.2;
  };

$ g++4x int.cc -c  -pedantic -pedantic-errors -std=c++98
int.cc:3: warning: converting to 'int' from 'double'
          ^^^^^^^

Yes, that's a bug -- independent of this static data member issue. We're apparently not being strict enough about integral constant expressions. I'll look into that.


--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


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