Re: Something weird with cp/decl.c switch statement

2007-06-05 Thread Andrew Haley
Aaron Gray writes: There is something weird with the switch statement in cp/decl.c:7105. GITWeb :- http://git.infradead.org/?p=gcc.git;a=blob;f=gcc/cp/decl.c;h=407e5db8d650f1d19c618c7b67566407c2d35fce;hb=master#l7105 Can someone verify this. Take a close look in a text editor

Re: Something weird with cp/decl.c switch statement

2007-06-05 Thread Andrew Pinski
On 6/5/07, Aaron Gray [EMAIL PROTECTED] wrote: There is something weird with the switch statement in cp/decl.c:7105. I dont think it will effect the decl.c's logic, but what does it say about the GCC's C parser, is this legal C ? Yes this is legal C :). Just for everyone else the code looks

Re: Something weird with cp/decl.c switch statement

2007-06-05 Thread Andrew Haley
Andrew Pinski writes: On 6/5/07, Aaron Gray [EMAIL PROTECTED] wrote: There is something weird with the switch statement in cp/decl.c:7105. I dont think it will effect the decl.c's logic, but what does it say about the GCC's C parser, is this legal C ? Yes this is legal C :). Just

Re: Something weird with cp/decl.c switch statement

2007-06-05 Thread Aaron Gray
On 6/5/07, Aaron Gray [EMAIL PROTECTED] wrote: There is something weird with the switch statement in cp/decl.c:7105. I dont think it will effect the decl.c's logic, but what does it say about the GCC's C parser, is this legal C ? Yes this is legal C :). Just for everyone else the code looks

Re: Something weird with cp/decl.c switch statement

2007-06-05 Thread Ian Lance Taylor
Andrew Pinski [EMAIL PROTECTED] writes: On 6/5/07, Aaron Gray [EMAIL PROTECTED] wrote: There is something weird with the switch statement in cp/decl.c:7105. I dont think it will effect the decl.c's logic, but what does it say about the GCC's C parser, is this legal C ? Yes this is legal

Re: Something weird with cp/decl.c switch statement

2007-06-05 Thread Mark Mitchell
Ian Lance Taylor wrote: And Simon already sent in a tested patch for a couple of days ago: http://gcc.gnu.org/ml/gcc-patches/2007-06/msg00199.html This patch is OK, thanks. -- Mark Mitchell CodeSourcery [EMAIL PROTECTED] (650) 331-3385 x713

Re: Something weird with cp/decl.c switch statement

2007-06-05 Thread Aaron Gray
On 6/5/07, Aaron Gray [EMAIL PROTECTED] wrote: MS Visual Studio does not parse it. Are you sure its legal C ? Yes I am. Try this: int f(int a) { switch (a) { case 1: { int b = 2; break; case 2: break; } } } This is valid C90 and C99, though invalid C++98. If