Compiler error

Michael Haggerty mhagger@blizzard.harvard.edu
Wed Sep 16 18:19:00 GMT 1998


Hi,

The following transcript illustrates an internal compiler error.  I
believe that the line `b.a();' should call the operator() method of
the static A within struct B.  Instead the compiler registers an
error.

======================================================================
$ uname -a
OSF1 tsunami.harvard.edu V4.0 564 alpha
$ e++ -v
Reading specs from /usr/local/egcs-1.1a/lib/gcc-lib/alpha-dec-osf4.0b/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
$ cat bug3ii.cc
struct A
{
    void operator() ();
};

struct B
{
    static A a;
};

void f()
{
    B b;
    b.a();
}

$ e++ -c bug3ii.cc
bug3ii.cc: In function `void f()':
bug3ii.cc:14: no matching function for call to `B::a ()'
$ 
======================================================================

My compiler was built with the following commands (unpatched source):

======================================================================
# made directory ~/download/egcs-1.1a-compilation and changed to it.
CC=ecc nice -2 ../egcs-1.1a/configure --prefix=/usr/common/egcs-1.1a --exec-prefix=/usr/local/egcs-1.1a --enable-shared
nice -2 make CFLAGS='-O' LIBCFLAGS='-g -O2' LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap
sudo nice -2 make install
ln -s /usr/local/egcs-1.1a/bin/c++ /usr/local/bin/e++
======================================================================

Michael

--
Michael Haggerty
mhagger@blizzard.harvard.edu



More information about the Gcc-bugs mailing list