[comp.lang.c++] Bug in g++ 1.37.0

zmact60@doc.ic.ac.uk (I S Roberts) (05/09/90)

The following code causes my g++ 1.37.0 to crash with the error
't3.cc:12: Segmentation violation'
'g++: Program cc1plus got fatal signal 11.'

--- cut here ---
typedef eek void (*)() ;

class foo {
public:
    foo(void (*f)()) ;
} ;

foo::foo(eek f)
{
}
--- second cut ---

Can someone please verify this and, if possible, check any later
versions of g++.

P.S. I Known this is not valid c++ code (should be typedef void (*eek)()).

Could someone also shed some light on the following error message;

In method CategoryEditor::CategoryEditor (class CategoryList *):
bad argument 1 for function `EventPushButton::EventPushButton
(const char *, auto void (*)(class Event &))'
(type was void (class CategoryEditor ::*)(class Event &))
in base initialization for class `EventPushButton'

In particular what does the `auto` mean and why I might be getting
the error.

Ian Roberts.
Imperial College. London.
zmact60@doc.ic.ac.uk
---
Disclaimer: I'm only a student so nothing I say counts...

av@kielo.uta.fi (Arto V. Viitanen) (05/09/90)

In article <1868@gould.doc.ic.ac.uk> zmact60@doc.ic.ac.uk (I S Roberts) writes:

ISR>    The following code causes my g++ 1.37.0 to crash with the error
ISR>    't3.cc:12: Segmentation violation'
ISR>    'g++: Program cc1plus got fatal signal 11.'

ISR>    --- cut here ---
ISR>    typedef eek void (*)() ;

ISR>    class foo {
ISR>    public:
ISR>        foo(void (*f)()) ;
ISR>    } ;

ISR>    foo::foo(eek f)
ISR>    {
ISR>    }
ISR>    --- second cut ---

ISR>    Can someone please verify this and, if possible, check any later
ISR>    versions of g++.


I tried it with g++ version 1.37.1 (based on GCC 1.37) and reseived errors

t3.cc:1: parse error before `void'
t3.cc:8: `eek' undeclared, outside of functions
t3.cc:8: parse error before `f'
t3.cc:9: argument list for `foo' does not match any in class
t3.cc:11: Segmentation violation
g++: Program cc1plus got fatal signal 11.

so error is still there ..
--
Arto V. Viitanen				         email: av@kielo.uta.fi
University Of Tampere,				   	       av@ohdake.uta.fi
Finland