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++/48365] New: Non-constant references in std::valarray::operator


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: unassigned@gcc.gnu.org
        ReportedBy: denin@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.


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