This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/15910] can't compile self defined void distance(std::vector<T>, std::vector<T>)
- From: "adah at netstd dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Aug 2005 03:11:12 -0000
- Subject: [Bug libstdc++/15910] can't compile self defined void distance(std::vector<T>, std::vector<T>)
- References: <20040610143911.15910.king.benjamin@mh-hannover.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From adah at netstd dot com 2005-08-10 03:11 -------
(In reply to comment #71)
> Subject: Re: can't compile self defined void distance(std::vector<T>,
std::vector<T>)
> On Aug 9, 2005, at 10:41 PM, adah at netstd dot com wrote:
> >
> > Passing this information to the user is difficult, unless GCC emits a
> > diagnostic message to help users do so, as GCC is currently doing on
> > the
> > missing of `typename'.
> even then as I said before when it comes down to it, nobody reads those
> messages as they think their code is correct.
> See my example when sequence points, we do warn about it in 4.0.0 and
> above
> (for C++; for C, we have warned since at least 3.0.4) and people still
> file bugs.
> Another example of where people don't read is the changes page, which
> describes
> changes to the compiler which could hinder (or benefit) them. One
> example is
> the change in the namelookup for templates to be more towards the
> standard. That
> example shows that we still get bug reports so even with a better error
> message,
> people will have something to complain about.
> -- Pinski
It is regretful that many people cannot read. But many people *can* read.
Converting from GCC 2 to GCC 3 made my code much more conformant to the C++
standard, owing to the messages like that of `typename'. And the messages
emitted by a compiler are read more often than something in a doc page.
The main problem of the current error message is that it even mentions nothing
about std::distance. So even an experienced programmer can have difficulty
finding out the problem if he does not know std::distance and has not
encountered the problem before. Not to say understand the problem. As the
very beginning, adding a message like `In instantiation of std::distance...'
will be helpful.
Yongwei
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15910