This is the mail archive of the gcc-patches@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: [c++] pedwarn about invalid pure specifiers (e.g "= 0L")


Michael Matz wrote:

Hi,

this patch adds the mentioned warning for invalid pure specifiers like

struct A {
  virtual int e() = 00;
  virtual int f() = 0L;
  virtual int g() = 0x0;
};

Initially I wanted to extend the interface of c_lex_with_flags to return the internal lexer flags (with CPP_N_OCTAL and such), then realized that this wouldn't catch "00", hence I anyway need the length of the token. But once I have this, it's also enough to identify the single valid form.

My only comment is that this should be an error, not a pedwarn.


It's not like there's lots of code out there using 0x0, or that anyone has every intentionally used 0L.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com


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