This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/11126] New: Error in valarray::operator =
- From: "lupoderi at tiscali dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jun 2003 15:36:09 -0000
- Subject: [Bug libstdc++/11126] New: Error in valarray::operator =
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11126
Summary: Error in valarray::operator =
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: lupoderi@tiscali.it
CC: gcc-bugs@gcc.gnu.org
The valarrat::operator=() doesn't change the size of right side operand.
For example, the following code fails the assert:
#include <iostream>
#include <valarray>
#include <assert.h>
using namespace std;
int main()
{
const int kLen = 2;
valarray<int> v1, v2;
int i;
v1.resize(kLen);
for (i=0; i<kLen; ++i)
v1[i] = i;
v2=v1;
assert (v2.size() == v1.size());
for (i=0; i<kLen; ++i)
assert (v2[i]==i);
return 0;
}