Article View: gnu.g++.bug
Article #86BUG in g++ 1.35.0 (b087)
From: 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
}
----------------------------------------------------------------
Technical Details
Message-ID:
<8907022009.AA08894@pink.aca.mcc.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!MCC.COM!rfgShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!MCC.COM!rfg From: rfg@MCC.COM (Ron Guilmette) Newsgroups: gnu.g++.bug Subject: BUG in g++ 1.35.0 (b087) Message-ID: <8907022009.AA08894@pink.aca.mcc.com> Date: 2 Jul 89 20:09:56 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 26