public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/56084] poor error recovery for missing ";"
Date: Wed, 23 Jan 2013 17:02:00 -0000	[thread overview]
Message-ID: <bug-56084-4-ECNBEpIrH2@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-56084-4@http.gcc.gnu.org/bugzilla/>


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56084

--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2013-01-23 17:02:02 UTC ---
> (Separately, I'm investigating whether there's some way to reduce the output
> when an invalid ostream operation is done, because the sheer number of
> overloads of operator<< causes pages of output due to G++'s verbose, and
> usually very useful, output describing argument deduction errors.)

One clear way is to avoid the repetition of:

In file included from
/home/manuel/test1/195333M/install/include/c++/4.8.0/iostream:40:0,
                 from test.cc:2:

Another is to add a "foverload-candidates-limit" option like
ftemplate-backtrace-limit, so if there are more than the limit (let's say 5),
the output is elided in a similar fashion.

Another suggestion is to don't show the full function declaration like in:

In file included from
/home/manuel/test1/195333M/install/include/c++/4.8.0/iostream:40:0,
                 from test.cc:2:
/home/manuel/test1/195333M/install/include/c++/4.8.0/ostream:532:5: note:
template<class _Traits> std::basic_ostream<char, _Traits>&
std::operator<<(std::basic_ostream<char, _Traits>&, const char*)
     operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
     ^
/home/manuel/test1/195333M/install/include/c++/4.8.0/ostream:532:5: note:  
template argument deduction/substitution failed:
test.cc:16:16: note:   cannot convert ‘me’ (type ‘Student’) to type ‘const
char*’
   std::cout << me << "\n";
                ^

where clang says in 1 line:

/usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/bits/ostream.tcc:320:5:
note: candidate function [with _CharT = char, _Traits = std::char_traits<char>]
not viable: no known conversion from 'Student' to 'const char *' for 2nd
argument
    operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)


  parent reply	other threads:[~2013-01-23 17:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-23 15:44 [Bug c++/56084] New: " manu at gcc dot gnu.org
2013-01-23 15:44 ` [Bug c++/56084] " manu at gcc dot gnu.org
2013-01-23 16:25 ` redi at gcc dot gnu.org
2013-01-23 17:02 ` manu at gcc dot gnu.org [this message]
2013-01-23 17:05 ` manu at gcc dot gnu.org
2013-01-23 17:11 ` manu at gcc dot gnu.org
2013-01-23 17:18 ` glisse at gcc dot gnu.org
2013-01-23 17:31 ` manu at gcc dot gnu.org
2013-01-23 17:44 ` redi at gcc dot gnu.org
2020-03-12 11:58 ` jakub at gcc dot gnu.org
2021-06-01  8:05 ` rguenth at gcc dot gnu.org
2021-06-01  9:23 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-56084-4-ECNBEpIrH2@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).