This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
template class support in egcs-970907
- To: Weiwen Liu <liu at hepunix dot physics dot yale dot edu>
- Subject: template class support in egcs-970907
- From: Mark Mitchell <mmitchell at usa dot net>
- Date: Mon, 8 Sep 1997 10:40:16 -0700
- Cc: egcs-bugs at cygnus dot com
- References: <Pine.OSF.3.96.970908130247.29601A-100000@ylws32>
- Reply-To: mmitchell at usa dot net
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