This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: case ranges in C++ (extension)
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 27 Jan 2004 19:26:09 -0800
- Subject: Re: case ranges in C++ (extension)
- Organization: CodeSourcery, LLC
- References: <Pine.LNX.4.58.0401271751540.3429@wotan.suse.de>
Michael Matz wrote:
Hi Mark,
GCC up to 3.3 accepted this:
switch (i) {
case 1 ... 10: /* bla */
}
also in C++. This extension was dropped with the new parser. I don't
know if knowingly, but at least I don't find any deprecation messages. C
still accepts it. Would reimplementing this be accepted?
Yes.
I don't think I dropped that functionality intentionally, and we should
probably support that extension for compatibility with GNU C. A
"pedwarn" should be issued if "pedantic" is set, of course. You should
test that it works in templates. You should also test that the code
that checks for duplicate case values and such works correctly in the
presence of this code.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com