This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: internal compiler error 364
- To: I Lee Hetherington <ilh at sls dot lcs dot mit dot edu>
- Subject: Re: internal compiler error 364
- From: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>
- Date: Sun, 19 Apr 1998 00:10:56 +0200 (MET DST)
- cc: egcs-bugs at cygnus dot com
On Fri, 10 Apr 1998, I Lee Hetherington wrote:
> The following short program causes internal compiler error 364:
>
> #include <vector>
>
> int main()
> {
> int i = 1;
> vector<int&> v;
> v.push_back(i);
> }
The current CVS snapshot does not ``die'' any more, but complains
x.cc:6: cannot form type pointer to reference type int & during template
instantiation
/sw/swtest/egcs/include/g++/stl_vector.h:69: cannot form type pointer to
reference type int & during template instantiation
/sw/swtest/egcs/include/g++/stl_alloc.h:225: cannot form type pointer to
reference type int & during template instantiation
/sw/swtest/egcs/include/g++/stl_vector.h:144: cannot form type reference
to reference type int &const during template instantiation
:
> (I'm not sure it is kosher to put references in an STL vector, but it
> does crash the compiler.) Here is the compiler output:
I believe it's not kosher. If I remember correctly, STL does make use of
operator=, which would cause extremly strange results for references!
(Recall that assignment of references has quite different semantics than
that of other data types.)
Gerald
--
Gerald Pfeifer (Jerry) Vienna University of Technology
pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/