http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48365

           Summary: Non-constant references in std::valarray::operator
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: de...@mail.ru


Created attachment 23819
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23819
Test code

When calling "valarray*scalar" arithmetic operators, where scalar is the
element of valarray, it is modified during execution, thus influencig the
result, though STL definition says that parameters of the operator are const
references, and the result is the new valarray object.
Attached is the code that produces output "4:12", while "4:6" expected, even
when compiled with -O0.

Reply via email to