delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/23/06:16:55

From: "Aleksey Kondratyev" <akondra AT no-spam-mv DOT ru>
Newsgroups: comp.os.msdos.djgpp
Subject: g++ class member initialization bug?
Date: Sat, 23 May 1998 12:53:15 +0400
Organization: Middle Volga Communication service
Lines: 23
Message-ID: <6k63ce$4t9$3@simtel.ru>
NNTP-Posting-Host: ppp13.usr.mv.ru
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Replying one message from comp.lang.c++ I discovered a strange
DJGPP behavior. IMHO C++ standard forbids the construction below.

class base
>{
>protected:
>      const int nn[]={10,20};

A C++ class members can be initialized by the use of a constructor only.
The author of an original message <6k5lsf$40i$1 AT news DOT iastate DOT edu>
in comp.lang.c++ claimed that g++ 2.8.0 compiles such things fine
but abandons to link saying that 'nn' is unresolved.
I tried DJGPP 2.8.0 and it did the same. Is it a bug?

----------------------------------------------------------------------
Aleksey Kondratyev
Ph.D. student of Ulyanovsk state University, Russia
http://www.mv.ru/~akondra
E-mail akondra AT mmf DOT univ DOT simbirsk DOT su
           akondra AT no-spam-mv DOT ru
           Remove "no-spam-" when replying


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019