This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/30416] SIGSEGV in valarray::cshift(n) on empty array
- From: "chris at bubblescope dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jan 2007 22:21:25 -0000
- Subject: [Bug libstdc++/30416] SIGSEGV in valarray::cshift(n) on empty array
- References: <bug-30416-1186@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from chris at bubblescope dot net 2007-01-09 22:21 -------
The standard refers to "(l+n)%size()", so if size()=0, that seems to be
undefined. On the other hand, it seems fairly obvious what should happen in
this case (ie nothing).
On an unrelated note, isn't there a another bug in the standard here, as it
seems to be assuming that (-1)%n = (n-1) for positive n, which isn't required
by the standard?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30416