🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Mike Lijewski Mon, 18 Sep 1989 19:59
initialization of public base class w/ derived class.
#438
Author: Mike Lijewski
Date: Mon, 18 Sep 1989 19:59
43 lines
1640 bytes
The following illustrates what I believe is a bug.  It seems to me that
in the line 'X b = a;', 'a' should be implicitly converted to an 'X', 
which should then initialize 'b'.


Script started on Mon Sep 18 14:45:46 1989

robbie(1)->cat a.cc

class X {
protected:
   int i;
};

class XX : public X {};

main(void)
{
   XX a;

   X b = a;
}

robbie(2)->g++ -v a.cc

g++ version 1.36.0-
 /usr/local/lib/gcc-cpp -+ -v -I/usr/local/include/g++-include -undef -D__GNU__ -D__GNUG__ -D__GNUC__ -D__cplusplus -Dunix -Di386 -Dsun386 -Dsun -D__unix__ -D__i386__ -D__sun386__ -D__sun__ a.cc /tmp/cca02845.cpp
GNU CPP version 1.35.96
 /usr/local/lib/gcc-cc1plus /tmp/cca02845.cpp -quiet -dumpbase a.cc -noreg -version -o /tmp/cca02845.s
GNU C++ version 1.36.0- (80386, Sun syntax) compiled by GNU C version 1.35.96.
default target switches: -m80387
a.cc: In function int main ():
a.cc:14: invalid initializer

robbie(3)->exit

script done on Mon Sep 18 14:46:32 1989

-- 
Mike Lijewski  (H)607/277-7623 (W)607/255-0539 (desk)607/255-2960
Cornell National Supercomputer Facility
ARPA: mjlx@cornellf.tn.cornell.edu  BITNET: mjlx@cornellf.bitnet
SMAIL:  1122 Ellis Hollow Rd. Ithaca, NY  14850
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