This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Minor bug gets bigger? (was Re: Potential minor bu revealed?)
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- To: Phil Edwards <phil at jaj dot com>
- Cc: "Stephen M. Webb" <stephen dot webb at bregmasoft dot com>, libstdc++ at gcc dot gnu dot org
- Date: 08 May 2002 22:46:57 +0200
- Subject: Re: Minor bug gets bigger? (was Re: Potential minor bu revealed?)
- Organization: CodeSourcery, LLC
- References: <200205071918.g47JImu08482@disaster.jaj.com> <20020508140113.A16763@disaster.basement.lan>
Phil Edwards <phil@jaj.com> writes:
[...]
| Now, if I also include <vector>, then the weird error appears. This makes
| sense to me and my limited understanding of template function overloading:
| the compiler never instantiates the template form of std::swap, since it
| already sees a non-template function.
Does that non-template function really realize a better match?
[...]
| > Other than the confusing error message, would this indicate a potential
| > problem in vector<bool>?
|
| Well, it wouldn't be the first problem with vector<bool>... anyhow,
| I note that the standard doesn't specify a non-template std::swap() for
| vector's "bit reference" class. But we have one. The standard /does/
| specify a static non-template member function, std::vector::swap, for the
| bit reference class, but we /don't/ have one.
|
| Moving the _Bit_reference's swap down inside the vector<bool> specialization,
| like the standard says, makes this problem go away. I'll post a patch
| after 3.1 is out.
Along with your patch, it would be interesting to trace the path that
leads to that obscure bug.
At least, this is one reason why we should continue moving
non-standard extensions out of std::.
Thanks for the detective work.
-- Gaby