🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Joe Fasano Thu, 15 Oct 1992 15:11
gcc-2.2.2 bug
#1213
Author: Joe Fasano
Date: Thu, 15 Oct 1992 15:11
38 lines
1307 bytes
Running gcc-2.2.2 on a SparcStation running SunOS 4.1.2

This example is from the ARM.

#include	<iostream.h>

class B {
public:
   void f(int);
};
void B::f (int i) { cout << "called B \n";}


class D : public B {
public:
    void f(char*);
};
void D::f (char* c) { cout << "called D\n";}



main()
{
    D pd;
    pd.f(1);   // error: D::f(char*) hides B::f(int)
  
               // g++ results in a call to B.
	       // section 13.1, page 310 of ARM(Ellis & Stroustrup) 
               // clearly states that it should generate an error.
}

- joe
joe@veritas.com
 -----------------------------------------------------------------------------
 Joe Fasano                         Internet: joe@veritas.com
 Veritas Software                   uucp:   ...!{apple,pyramid}!veritas!joe
 4800 Great America Pkwy, Ste 420
 Santa Clara, CA  95054             Phone:  408-727-1222
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