This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch] Apply DR434 resolution to <debug/bitset>
- From: Jonathan Wakely <cow at compsoc dot man dot ac dot uk>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Fri, 6 May 2005 11:23:34 +0100
- Subject: Re: [patch] Apply DR434 resolution to <debug/bitset>
- References: <20050506095444.GB17135@compsoc.man.ac.uk> <427B428E.4090408@suse.de>
On Fri, May 06, 2005 at 12:10:22PM +0200, Paolo Carlini wrote:
> Jonathan Wakely wrote:
>
> >Found this while looking at the vector<bool> issue I posted earlier.
> >
> >The resolution to DR434 was not applied to <debug/bitset> which causes
> >testsuite/23_containers/bitset/to_string/1.cc to FAIL in debug mode.
> >
> >The attached patch fixes the FAIL on 4.0 and mainline, OK for both?
> >(DR434 resolution is not on the 3.4 branch)
> >
> >
> Yes, it's ok.
Thanks. Will commit later today.
> By the way, what happened of that discussion about debug-pedantic vs
> basic_string? Shall we have a consistent policy about that? In any case,
> I don't think this is a case where that distinction is important, but if
> we (meaning, at least, me and you ;) really want zero failures in
> debug-mode we should start telling apart testcases having to do with
> details of our implementation from testcases simply enforcing the letter
> of the standard.
That's how I noticed that most of the 21_strings tests aren't running on
my system, I wasn't seeing the element_access/char/empty.cc FAIL on
mainline, only on 4.0
A temporary workaround would be to disable the non-const part of the
tests that fail, but that's just pretending the problem's gone away.
The ideal solution is to make basic_string's debug check support the v3
extension that s[s.size()] returns char() for non-const s.
I don't know how to do this cleanly in Doug's debug framework.
This check in string::operator[] needs to test pos < size in pedantic
mode but pos <= size otherwise:
_GLIBCXX_DEBUG_ASSERT(__pos < size());
Maybe we need something like this
#ifdef _GLIBCXX_DEBUG_PEDANTIC
#define _GLIBCXX_DEBUG_STRING_ELEMENT_ACCESS(A) \
_GLIBCXX_DEBUG_ASSERT(__pos < size())
#else
#define _GLIBCXX_DEBUG_STRING_ELEMENT_ACCESS(A) \
_GLIBCXX_DEBUG_ASSERT(__pos <= size())
#endif
> >Should I use the DR ChangeLog format like this?
> >
> >
> Seems ok, like mine ;)
Yeah, copy'n'pasted from your :)
jon