🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1955

Bug in constructor for aggregate.

#1955
From: hcl
Date: Mon, 08 May 1989 09:03
34 lines
939 bytes
Compiler version 1.34.2, SUNoS 4.0 SUN 3

Strousstrup page 287 on members of aggregate - 

- An object can be a member of an aggregate only (1) if the object's
class do not have a constructor, or (2) if one of its constructors
takes no argument ... -

According to this the code below should compile happily as it did
under 1.34.1.

class foo
{
    int i;
public:
    foo() { i = 0;}
};

class bar
{
public:
    foo f[3];
};

main()
{
    bar t;
}

g++ -c  test.cc
In function int main ():
test.cc:16: invalid use of non-lvalue array

				
Technical Details
Message-ID: <8905080902.AA11480@randi.itk.unit.no>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!itk.unit.no!hcl

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!itk.unit.no!hcl
From: hcl@itk.unit.no
Newsgroups: gnu.g++.bug
Subject: Bug in constructor for aggregate.
Message-ID: <8905080902.AA11480@randi.itk.unit.no>
Date: 8 May 89 09:03:17 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 34