This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Degraded C++ error messages.
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Carlo Wood <carlo at alinoe dot com>
- Cc: libstdc++ at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: 07 Nov 2003 17:16:47 +0100
- Subject: Re: Degraded C++ error messages.
- Organization: Integrable Solutions
- References: <20031107153251.GA27369@alinoe.com>
Carlo Wood <carlo@alinoe.com> writes:
| Hiya,
|
| this is going to be a thread to which I will add unreadable
| or very much degraded error message of g++. Being mainly
| a *user* of g++, it is my experience that the error messages
| have gotten less and less practical value.
|
| Example 1.
|
| 5: std::vector<int> v;
| 6: int* p = v.begin()->base();
|
| ~>g++-2.95.3 troep.cc
| troep.cc: In function `int main()':
| troep.cc:6: request for member `base' in `*v.vector<int,allocator<int> >::begin()', which is of non-aggregate type `int'
|
| ~>g++-3.3.2 troep.cc
| troep.cc: In function `int main()':
| troep.cc:6: error: request for member `base' in `*(&std::vector<_Tp,
| _Alloc>::begin() [with _Tp = int, _Alloc =
| std::allocator<int>]())->__gnu_cxx::__normal_iterator<_Iterator,
| _Container>::operator->() const [with _Iterator = int*, _Container =
| std::vector<int, std::allocator<int> >]()', which is of non-aggregate type `
| int'
|
| ~>g++-cvs-3.4 troep.cc
| troep.cc: In function `int main()':
| troep.cc:6: error: expected type-name
| troep.cc:6: error: expected `::'
| troep.cc:6: error: expected `~'
| troep.cc:6: error: expected identifier
I much prefer the error message that displays expressions (althougth it
could be improved), but some people seems to like the "typed" ones --
it should be recalled that C++ expressions can not be consistently and
accurately captured by types only. I find it quite unreadable.
Clearly, the "expected" thingy is Morse to me.
(Interestingly, this kind of incomprehensible messages has been
pointed out by Benjamin last week; there were quite hilarous variations
on them).
-- Gaby