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]

c++/691: i'm new, so this may not be a bug



>Number:         691
>Category:       c++
>Synopsis:       i'm new, so this may not be a bug
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 25 16:36:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Michael Case
>Release:        gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
>Organization:
>Environment:
redhat linux 6.2 with some stuff added, running on
a dell precision 420 
>Description:
could be an ice-on-illegal-code

compiling a generic function in which i pass a
function to mytransform algorithm which in turn uses 
another template called square_it.

g++ -O -c ch8.cpp
ch8.cpp: In function `int main()':
ch8.cpp:19: Internal compiler error.
ch8.cpp:19: Please submit a full bug report to `egcs-bugs@egcs.cygnus.com'.
ch8.cpp:19: See <URL:http://egcs.cygnus.com/faq.html#bugreport> for details.
make: *** [ch8.o] Error 1
>How-To-Repeat:
basically, ch8.cpp looks like this:

#include <iostream>
#include <vector>

#include "myalgos.cpp"

using std::cout;
using std::endl;
using std::vector;

int main()
{
  vector<float> vi, v2;
  for (float i = 0; i < 10; i++)
    vi.push_back(i);
  mytransform(vi.begin(), vi.end(), back_inserter(v2), square_it);
  for (vector<float>::iterator i = v2.begin(); i != v2.end(); i++)
    cout << *i << endl;
}
>Fix:
Work-around for me was to make square_it a float and be done
with it.

The only reason I'm reporting this is because the error told me
to :-).
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="myalgos.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="myalgos.cpp"

LyoqCiAqIHRoaXMgaXMgc2ltcGx5IGEgcGxhY2UgdG8gcHV0IGFsbCBvZiBDaGFwdGVyIDgncyBh
bGdvcml0aG1zLgogKi8KCgp0ZW1wbGF0ZTxjbGFzcyBJbiwgY2xhc3MgT3V0LCBjbGFzcyBYPiAK
dm9pZCBteXRyYW5zZm9ybShJbiBiLCBJbiBlLCBPdXQgZCwgWCBmKGNvbnN0IFgmIHgpKQp7CiAg
d2hpbGUgKGIgIT0gZSkKICAgICpkKysgPSBmKCpiKyspOwp9Cgp0ZW1wbGF0ZTxjbGFzcyBYPiBY
IHNxdWFyZV9pdCAoY29uc3QgWCYgaSkKewogIHJldHVybiBpICogaTsKfQo=

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