template class support in egcs-970907

Mark Mitchell mmitchell@usa.net
Mon Sep 8 10:37:00 GMT 1997


I believe that you did not fully rebuild cc1plus when you obtained the new
snapshot.  The example works fine for me.  The line that your version
is complaining about contains a member template; support for that was
added in the 970907 snapshot.  One other possibility is that the
cp/parse.c distributed with the new snapshot was not regenerated, and
that you did not regenerate it locally.  You could try moving that
file out of the way and rebuilding.

>>>>> "Weiwen" == Weiwen Liu <liu@hepunix.physics.yale.edu> writes:

    Weiwen> Hi,

    Weiwen> New gcc in egcs-970907 fails to compile the following
    Weiwen> program, while egcs-970904 succeeded.

    Weiwen> // This example compiles using the new STL<ToolKit> from
    Weiwen> ObjectSpace, Inc.  // STL<ToolKit> is the EASIEST to use
    Weiwen> STL that works on most platform/compiler // combinations,
    Weiwen> including cfront, Borland, Visual C++, C Set++,
    Weiwen> ObjectCenter, // and the latest Sun & HP compilers. Read
    Weiwen> the README.STL file in this // directory for more
    Weiwen> information, or send email to info@objectspace.com.  //
    Weiwen> For an overview of STL, read the OVERVIEW.STL file in this
    Weiwen> directory.

    Weiwen> #include <iostream.h> #include <vector.h> #include
    Weiwen> <algo.h>

    Weiwen> int main () { vector<int> v1; // Empty vector of integers.
    Weiwen> cout << "empty = " << v1.empty () << endl; cout << "size =
    Weiwen> " << v1.size () << endl; cout << "max_size = " <<
    Weiwen> v1.max_size () << endl; v1.push_back (42); // Add an
    Weiwen> integer to the vector.  cout << "size = " << v1.size () <<
    Weiwen> endl; cout << "v1[0] = " << v1[0] << endl; return 0; }

--
Mark Mitchell		mmitchell@usa.net
Stanford University	http://www.stanford.edu




More information about the Gcc-bugs mailing list