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]
Other format: [Raw text]

[Bug libstdc++/11126] New: Error in valarray::operator =


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;
}


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