Thread View: gnu.g++.bug
1 messages
1 total messages
Started by hcl
Mon, 08 May 1989 09:03
Bug in constructor for aggregate.
Author: hcl
Date: Mon, 08 May 1989 09:03
Date: Mon, 08 May 1989 09:03
34 lines
939 bytes
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
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