This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/1788: gcc 2.95.2 gives ICE when declaring variables as static in classes
- From: rodrigc at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, mail at perliden dot com, nobody at gcc dot gnu dot org
- Date: 24 Feb 2002 19:09:19 -0000
- Subject: Re: c++/1788: gcc 2.95.2 gives ICE when declaring variables as static in classes
- Reply-to: rodrigc at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, mail at perliden dot com, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: gcc 2.95.2 gives ICE when declaring variables as static in classes
State-Changed-From-To: analyzed->closed
State-Changed-By: rodrigc
State-Changed-When: Sun Feb 24 11:09:19 2002
State-Changed-Why:
Compiling your testcase with gcc 3.0.4 yields the following
compilation errors:
Bug.cc:5: declaration does not declare anything
Bug.cc:5: parse error before `static'
Bug.cc:9: parse error before `static'
Bug.cc:9: `T' was not declared in this scope
Bug.cc:9: template argument 1 is invalid
Bug.cc:9: ISO C++ forbids declaration of `foobar' with no typeBug.cc:5: declaration does not declare anything
Bug.cc:5: parse error before `static'
Bug.cc:9: parse error before `static'
Bug.cc:9: `T' was not declared in this scope
Bug.cc:9: template argument 1 is invalid
Bug.cc:9: ISO C++ forbids declaration of `foobar' with no type
If the testcase is changed, it can be compiled:
template <typename T>
class Foo
{
static const int foobar;
int vertices[foobar];
};
template <typename T>
const int Foo<T>::foobar = 4;
int main()
{
Foo<int> foo;
return(0);
}
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=1788