[Bug c++/88512] Too much STL in error output
glisse at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Dec 16 07:38:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88512
--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Jonny Grant from comment #3)
> Updated output I had executed from STL with clear candidate suggestions:
>
> $ g++ -Wall -o stl_string stl_string.cpp
> stl_string.cpp: In function ‘int main()’:
> stl_string.cpp:7:27: error: no matching function for call to
> ‘std::string::erase(std::size_t&, std::string::iterator)’
> str.erase(s, str.end());
> ^
> candidates are:
> std::string& std::string::erase(size_type index = 0, size_type count =
> npos)
> std::string::iterator std::string::erase(const_iterator first,
> const_iterator last)
> std::string::iterator std::string::erase(const_iterator position)
Maybe for the standard library... For user code I would still want a reminder
somewhere of what size_type, iterator, const_iterator and string are aliases
for. Besides, gcc currently tells you why the candidate was not picked, which
is also useful.
What I expect would work is to have the message as a tree that originally only
shows the error message, but where you can click to show the candidates, click
a candidate to show why it fails, click a type to see what it aliases, etc. But
that's only doable through an IDE.
More information about the Gcc-bugs
mailing list