newed array initailization

Fariborz "Skip" Tavakkolian fst@real.com
Wed Jan 6 18:50:00 GMT 1999


I get an internal error when compiling the following:

====================================================================
(fst@fst)$ cat bar.c++

main()
{
        char * ptr = new char[6] = {"hello"};
}
(fst@fst)$ g++ -pedantic bar.c++
bar.c++: In function `int main()':
bar.c++:4: warning: ANSI C++ forbids initialization of new expression with `='
bar.c++:4: warning: initialization in array new
bar.c++:4: Internal compiler error.
bar.c++:4: Please submit a full bug report to `egcs-bugs@cygnus.com'.
(fst@fst)$ g++ -v
Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.29/specs
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
(fst@fst)$ uname -a
Linux fst 2.0.34 #9 Wed Nov 18 12:08:32 PST 1998 i586 unknown


===================================================================

It compiles fine if the initializer is {'h', 'e' , 'l', 'l', 'o', 0}




More information about the Gcc-bugs mailing list