[Bug libstdc++/30416] SIGSEGV in valarray::cshift(n) on empty array

chris at bubblescope dot net gcc-bugzilla@gcc.gnu.org
Tue Jan 9 22:21:00 GMT 2007



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



More information about the Gcc-bugs mailing list