Article View: be.comp.programming
Article #6478Re: gcc internal compiler error (was: ISO C++ does not permit ...)
From: Nicolas Barbier
Date: Wed, 11 Dec 2002 13:02
Date: Wed, 11 Dec 2002 13:02
38 lines
1923 bytes
1923 bytes
Jack D wrote:
> Er zit een fout in je code. Je kan een statische variabele enkel oproepen
> als A::var, niet als member variabele van een instantie...
Heeft altijd al gemogen dacht ik, en blijkbaar geeft GCC er in ANSI-modus
ook geen fouten op:
<sessie>
itsme@stoned:~$ cat test.cpp
#include <iostream>
class A
{
public:
static int var;
};
int A::var = 0;
int main()
{
A a;
a.var = 6;
std::cout << A::var << std::endl;
}
itsme@stoned:~$ g++-3.2 -W -Wall -ansi -pedantic test.cpp
itsme@stoned:~$ ./a.out
6
itsme@stoned:~$
</sessie>
Mijn punt was dat, hoe fout de code ook is, GCC nooit een "internal
compiler error" hoort te geven. En dat is dan blijkbaar ook opgelost in die
nieuwere versie.
--
Nicolas Barbier
Technical Details
Message-ID:
<3df73778$0$3390$afc38c87@sisyphus.news.be.easynet.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-08!supernews.com!easynet-quince!easynet.net!feed1.news.be.easynet.net!sisyphus.news.be.easynet.net!not-for-mailReferences:
<3df5fa6b$0$20770$ba620e4c@news.skynet.be> <3df63dab$0$3394$afc38c87@sisyphus.news.be.easynet.net> <3df655a2$0$3397$afc38c87@sisyphus.news.be.easynet.net> <BA1CE7D4.1752B%jack_221NOSP@Mhotmail.com>Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: fcea4,c436a161484c41f1 X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2002-12-11 05:02:49 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-08!supernews.com!easynet-quince!easynet.net!feed1.news.be.easynet.net!sisyphus.news.be.easynet.net!not-for-mail Message-ID: <3df73778$0$3390$afc38c87@sisyphus.news.be.easynet.net> From: Nicolas Barbier <anti@spam.invalid> Subject: Re: gcc internal compiler error (was: ISO C++ does not permit ...) Newsgroups: be.comp.programming Date: Wed, 11 Dec 2002 14:02:29 +0100 References: <3df5fa6b$0$20770$ba620e4c@news.skynet.be> <3df63dab$0$3394$afc38c87@sisyphus.news.be.easynet.net> <3df655a2$0$3397$afc38c87@sisyphus.news.be.easynet.net> <BA1CE7D4.1752B%jack_221NOSP@Mhotmail.com> User-Agent: KNode/0.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Lines: 38 Organization: [ posted via Easynet Belgium ] NNTP-Posting-Host: 213.193.183.58 X-Trace: 1039611768 3390 213.193.183.58 X-Complaints-To: abuse@be.easynet.net