[gnu.g++.bug] visibility error with destructors

schmidt@glacier.ics.uci.edu (Doug Schmidt) (11/23/89)

The following example illustrates a bug with g++ 1.36.1:

----------------------------------------
#include <stdio.h>

class foo
{
public:
  foo () {printf ("foo ()\n");}
private:
  ~foo () {printf ("~foo ()\n");}
};

main ()
{
  foo *bar = new foo;
}
----------------------------------------

g++ complains:

test.c:9: class `foo' only defines a private destructor and has no friends

cfront 2.0 compiles this with no problems.

Doug
--
schmidt@ics.uci.edu (ARPA) |   Per me si va nella citta' dolente.
office: (714) 856-4043     |   Per me si va nell'eterno dolore.
                           |   Per me si va tra la perduta gente.
                           |   Lasciate ogni speranza o voi ch'entrate.