This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/1788: gcc 2.95.2 gives ICE when declaring variables as static in classes


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]