🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c++
Article #79

Is this a C++ bug?

#79
From: Bjarne Stroustrup
Date: Sun, 09 Mar 1986 20:00
24 lines
1099 bytes
> From: keith@cecil.UUCP (keith gorlen)
> Newsgroups: net.lang.c++
> Subject: Is this a C++ bug?
> Organization: NIH-CSL, Bethesda, MD
> 
> A member of a const argument cannot be used as a const argument in a
> function call:
> 
> class Foo { int i; };
> 
> class Bar {
> 	Foo foo;
> public:
> 	void g(const Foo&);
> 	void f(const Bar& b)	{ g(b.foo); }	// gets error
> };
> 
> "constbug.c", line 7: error: address of member Bar::foo of const Bar 
> 
> Is this a bug in C++ Release 1.0 or a "feature"?

It is a 1.0 bug (not a language bug).
Sorry.
My cfront compiles it without a hickup.
Technical Details
Message-ID: <5097@alice.uUCp>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!alice!bs

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site alice.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!alice!bs
From: bs@alice.UucP (Bjarne Stroustrup)
Newsgroups: net.lang.c++
Subject: Is this a C++ bug?
Message-ID: <5097@alice.uUCp>
Date: Sun, 9-Mar-86 15:00:44 EST
Article-I.D.: alice.5097
Posted: Sun Mar  9 15:00:44 1986
Date-Received: Mon, 10-Mar-86 20:18:41 EST
Organization: Bell Labs, Murray Hill
Lines: 24