[PATCH] Fix PR c++/30759: Initializer-list accepted for object of non-POD type

Mark Mitchell mark@codesourcery.com
Thu May 31 21:00:00 GMT 2007


Gabriel Dos Reis wrote:

> modulo the spelling of the flag as flag_cxx98 instead of flag_cpp98, the patch
> if fine.  Many thanks!

I don't think adding a new flag is such a good idea, especially since
it's setting is not independent of flag_cxx0x.

For better future-proofing, we should introduce an enum:

  enum cxx_dialect {
    cxx98,
    cxx0x
  };

and then replace flag_cxx0x with:

  enum cxx_dialect dialect;

Then, we can test "dialect != cxx98" and "dialect == cxx0x" as appropriate.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list