Thread View: gnu.g++.bug
1 messages
1 total messages
Started by Ron Guilmette
Sun, 02 Jul 1989 20:09
BUG in g++ 1.35.0 (b087)
Author: Ron Guilmette
Date: Sun, 02 Jul 1989 20:09
Date: Sun, 02 Jul 1989 20:09
26 lines
1125 bytes
1125 bytes
Using g++ 1.35.0/sun3, the compiler generates the proper error,
but it associate it with the wrong line. Specifically, the
error is issued for the line where "s" is declared rather than
the line where the invalid assignment to "s.data_member_2" is
located.
b087.C:
----------------------------------------------------------------
// Check that it is illegal to assign to an element of an
// aggregate type object if the whole object (or the element
// being assigned to) is "const". Note that initializations
// are an exception.
struct S {
int data_member_1;
int data_member_2;
};
void test ()
{
const struct S s = { 3, 5 };
s.data_member_2 = 99; // ERROR
}
----------------------------------------------------------------
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