home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!sgigate!odin!sgihub!zola!void!thant
- From: thant@void.esd.sgi.com (Thant Tessman)
- Newsgroups: comp.sys.sgi
- Subject: Re: C++ 3.0
- Message-ID: <pad8ogo@zola.esd.sgi.com>
- Date: 1 Sep 92 17:09:05 GMT
- References: <3922@sicsun.epfl.ch>
- Sender: news@zola.esd.sgi.com (Net News)
- Organization: Silicon Graphics, Inc. Mountain View, CA
- Lines: 58
-
-
- So what's really weird is if you replace the line:
-
-
- > const String B = "Hello World";
-
- with:
-
- char* s = "Hello World";
- const String B = s;
-
- It works. Looks like a compiler bug to me. I will forward
- to the appropriate people.
-
- thant
-
-
-
- In article <3922@sicsun.epfl.ch>, lapique@siisg1.epfl.ch writes:
- > The following code illustrates an anomaly between
- > IRIX 4.0.5 maint C++3.0 and version IRIX 4.0.5 C++2.1.1:
- > -----------------------------------------------------------
- > #include <string.h>
- > class String {
- > private:
- > char *data;
- > public:
- > String(char *value =0){
- > data = new char[strlen(value) + 1];
- > strcpy(data,value);
- > }
- > };
- > main()
- > {
- > const String B = "Hello World";
- > }
- > -------------------------------------------------------------
- > Compiled with C++3.0 :
- >
- > accom: Error: string.C, line 13: __2__X1 undefined
- > struct String __1B = (*( (__2__X1 = "Hello World"), ( ((
- > -------------------------------------------------^
- > accom: Error: string.C, line 13: illegal combination of pointer and integer, op =
- > struct String __1B = (*( (__2__X1 = "Hello World"), ( ((
- > -------------------------------------------------^
- > accom: Error: string.C, line 13: types : int versus pointer to char
- > struct String __1B = (*( (__2__X1 = "Hello World"), ( ((
- > -------------------------------------------------^
- > accom: Error: string.C, line 14: redeclaration of __2__X1
- > char *__2__X1 = 0 ;
- > --------------^
- > Compiled with C++2.1.1 : OK
- > ---------------------------------------------------------------------
- > Francis Lapique
- > Swiss Federal Institute of Technology-Lausanne
- > Computer Center-SIC/SII
- > E-mail : lapique@sic.epfl.ch
- > voice : 41-21-693-4596
-