This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/48365] New: Non-constant references in std::valarray::operator
- From: "denin at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 30 Mar 2011 12:56:11 +0000
- Subject: [Bug libstdc++/48365] New: Non-constant references in std::valarray::operator
- Auto-submitted: auto-generated
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.