This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Status of the concepts checking code
On Sat, Dec 29, 2001 at 10:59:39PM +0100, Peter Schmid wrote:
> thank you very much for taking care of the checking code and fixing PR
> libstdc++/2054. After updating the gcc 3.1 cvs sources today the test
> case enclosed in this PR compiles fine. But if I replace the call to
> lower_bound by a call to upper_bound the problem shows up again. I
> propose that the checking code should be changed in the same way for
> upper_bound and equal_range.
Almost certainly correct. (I say "almost" because I haven't looked yet.)
I will check soon.
> Furthermore, I would like to note that Mr Siek updated the checking
> code in the boost repository. Could you please incorporate his changes
> in libstdc++ if this is possible and is making sense.
Not really, sorry. I checked the Boost repository yesterday (via
sourceforge's cvsweb) while working on 2054. The two versions have
diverged quite a bit. What's more, I cannot tell the purpose behind many
of the changes, because the cvs log messages consist of fragments like
"make more changes to code".
We also have many local changes to the version in libstdc++. The wrappers
and workarounds for broken compilers that need to be in Boost code should
not be in our code, for example. Things like sink_unused_variable_warning()
are better replaced by __attribute__((unused)), and so forth.
I /did/ find a couple of isolated fixes that were easy to follow.
Those changes are in my local tree for testing, and I'll commit them soon
if they pass.
I will gladly accept patches, but to my sorrow and amazement the versions
have diverged faster than I thought possible. I personally will not have
time to merge the Boost sources anytime soon; not before 3.1 if I'm going
to do any decent amount of PR fixes and doxygen work.
> I ran many g++ and libstdc++ tests with the checking code enabled and
> found only three problems, except for known coding "errors", missing
> functions for random access iterators, in boost.
>
> First, is it possible to turn the checking code off on a per file
> basis? Explicitly undefining _GLIBCPP_CONCEPT_CHECKS had no effect,
> either on the gcc command line or in the source file.
Not at present. For fine-grained control, it should start as "off",
and then be explictly defined as you need it.
> Secondly, there is PR 1870 which encloses a test case that is rejected
> by the checking code but I believe is legal. The code is in Josuttis'
> book and in Vandevoordes book.
> Alexandre Oliva says it is illegal, though. But I do not comprehend
> his reasoning, since the code indeed compiles if checking is
> disabled, in contrast to his opinion that the code is illegal.
I haven't gotten to that one yet. I'll try to look after I'm done with
deque and 1853.
> Third, list_modifiers.cc from the libstdc++ testsuite does not
> compile.
There's a message from me in the list archives about this.
> /mnt/egcs/gcc/libstdc++-v3/testsuite/23_containers/list_modifiers.cc:103: instantiated from here
> /mnt/egcs/build/i686-pc-linux-gnu/libstdc++-v3/include/bits/boost_concept_check.h:175: non-static
> const member `const int T::itsId', can't use default assignment operator
> /mnt/egcs/build/i686-pc-linux-gnu/libstdc++-v3/include/bits/boost_concept_check.h:175: non-static
> const member `const bool T::willThrow', can't use default assignment
> operator
The default (synthesized) assignment operator does memberwise copies,
so here it's assigning a value to a 'const bool', which can't happen.
> I verified that libstdc++/2504 is indeed fixed. Could you please close
> this PR. The following PRs are no longer failing: optimisation/4785,
> c/3741 and c++/2295. Would you mind closing these PRs, too?
Done. Thanks for letting us know!
Phil
--
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace. We seek
not your counsel, nor your arms. Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen. - Samuel Adams