This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49867] [C++0x] ICE on lambda inside switch with case labels in the lambda
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 27 Jul 2011 13:04:14 +0000
- Subject: [Bug c++/49867] [C++0x] ICE on lambda inside switch with case labels in the lambda
- Auto-submitted: auto-generated
- References: <bug-49867-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49867
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-07-27 13:03:35 UTC ---
void
foo ()
{
switch (3)
{
struct S
{
void bar ()
{
case 3: break;
}
};
}
}
doesn't ICE, but is accepted while IMHO it should not. Or
void
baz ()
{
while (1)
{
struct S
{
void bar ()
{
continue;
}
};
}
}
I guess we should save/clear and restore
parser->in_statement and parser->in_switch_statement_p around parsing of the
nested functions (or already the types?) and lambda bodies (or whole lambdas?).