This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

egcs-970824 in i586-pc-linux-gnulibc1


Hello,

Here are some results of a quick test of the 1997-09-24 snapshot on an
i586-pc-linux-gnulibc1

1) 'make bootstrap LANGUAGES="c c++"' works, but warns while compiling
   the stage1 compiler:

> makeinfo.c:109: warning: `alloca' redefined
> /usr/include/alloca.h:44: warning: this is the location of the previous
definition

   'make install' does not complain.

2) Using a template conversion operator in a class does not work, or
   triggers an internal compiler error. Yes, I know member templates are
   new in egcs, but anyway, here's the code (btw, changing the name of
   class null does not help):

$ uname -a ; c++ --version
Linux wc.hermes.si 2.0.30 #1 Tue Apr 22 10:49:45 EDT 1997 i586 unknown
egcs-2.90.10 970924 (gcc2-970802 experimental)
$ cat null.h
/* -*- C++ -*- */

class null {
    null (null const&);
    void operator& ();

  public:
    null () {}

    template <typename T>
    operator T* () const { return 0; }
} const null;
$ cat null.cc

#include "null.h"

int main ()
{
    int *p = null;

    return 0;
}
$ c++ -ansi -pedantic -Wall -c null.cc
null.cc: In function `int main()':
null.cc:6: cannot convert `null' from type `null' to type `int *'
null.cc:6: warning: unused variable `int * p'
$ cat null-cast.cc

#include "null.h"

int main ()
{
    int *p = static_cast<int*>(null);

    return 0;
}
$ c++ -ansi -pedantic -Wall -c null-cast.cc
null-cast.cc: In function `int main()':
null-cast.cc:6: Internal compiler error.
null-cast.cc:6: Please submit a full bug report to `egcs-bugs@cygnus.com'.
$ cat null-oldcast.cc

#include "null.h"

int main ()
{
    int *p = (int*) null;

    return 0;
}
$ c++ -ansi -pedantic -Wall -c null-oldcast.cc
null-oldcast.cc: In function `int main()':
null-oldcast.cc:6: cannot convert `null' from type `null' to type `int *'
null-oldcast.cc:6: warning: unused variable `int * p'

--
Branko Cibej   <branko.cibej@hermes.si>
HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia
phone: (++386 61) 186 53 49  fax: (++386 61) 186 52 70




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]