Thread View: gnu.g++.bug
1 messages
1 total messages
Started by Ron Guilmette
Sun, 12 Mar 1989 19:42
BUG in G++ 1.34.0 - missed error (a different one)
Author: Ron Guilmette
Date: Sun, 12 Mar 1989 19:42
Date: Sun, 12 Mar 1989 19:42
37 lines
1352 bytes
1352 bytes
This error is related to (but different from) the last one I posted
regarding goto's jumping around object declarations.
In this case, G++ 1.34.0/Sun3 fails to issue an error when an
"unstructured" switch statement causes an apparently bogus transfer
of control past a declaration/initialization.
If an error message is ever issued for this condition, it seems like
it should be issued for the line indicated below.
/*
Description - check that "it is not possible to transfer control past a
declaration with an (implicit or explicit) initializer"
as called for by the "manual", section 9.11, page 296.
This test checks that legal but "unstructured" forms of
switch statements are not allowed to circumvent the transfer
rules for goto statements.
*/
class c {
public:
c (int i);
~c ();
};
void test ()
{
switch (1) {
case 0:
{
c c_object (1);
case 1: // ERROR - case in wrong binding contour
break;
}
}
}
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads