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++/30416] SIGSEGV in valarray::cshift(n) on empty array



------- Comment #4 from sebor at roguewave dot com  2007-01-09 22:34 -------
(In reply to comment #3)
> 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).

The requirement is to "return an object of length size() each of whose
elements..." If there are no elements the "..." doesn't/cannot apply. Note
that an analogous expression is used in rotate_copy which I assume we all
agree is well defined for zero-length ranges.


-- 


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


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