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: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jan 2007 03:33:40 -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 #7 from gdr at integrable-solutions dot net 2007-01-10 03:33 -------
Subject: Re: SIGSEGV in valarray::cshift(n) on empty array
"sebor at roguewave dot com" <gcc-bugzilla@gcc.gnu.org> writes:
| (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.
I disagree. The specification is not that of unconditional return.
And if that is what is intended, then that is not what the standard wrote.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30416