https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88512

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonny Grant from comment #3)
> Hi Marc
> 
> I agree to useful to have the option to keep on for regular code.
> Perhaps a way just to turn off all expansive output for STL's std namespace?

But what about cases where you call a std::lib function template that accepts
any arguments, which forwards them to some other std::lib function that gives
an error because the args are invalid. If you remove all the context that's in
the std::lib then you remove the relevant context.


> The easiest would be to remove cxx11 namespace from the messages
> "std::__cxx11::basic_string" etc, so at least that doesn't shwo.
> 
> 
> 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)

You've removed all the information that says *why* it didn't match (e.g. no
conversion from size_t to const_iterator). That's useful.

You don't improve the compiler's diagnostics by optimising for a single example
where the verbose info happens to be unnecessary. That info is useful in other
cases.

Reply via email to