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++/39728] diagnostic for private operator= is voluminous and unhelpful
Date: Mon, 16 Apr 2012 11:34:00 -0000	[thread overview]
Message-ID: <bug-39728-4-mg0ij2ef4G@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-39728-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-16 11:34:01 UTC ---
(In reply to comment #5)
> /home/redi/gcc/4.x/include/c++/4.8.0/bits/ios_base.h: In member function
> 'std::basic_ios<char>& std::basic_ios<char>::operator=(const
> std::basic_ios<char>&)':
> 
> This is useful info, it tells me the (implicitly-defined) context in which the
> private operator= was needed.

OK, the info maybe be useful. I think the way to show it could be better. But
the major improvement would be the typedefs preservation.

> 
> /home/redi/gcc/4.x/include/c++/4.8.0/bits/ios_base.h:791:5: error:
> 'std::ios_base& std::ios_base::operator=(const std::ios_base&)' is private
>      operator=(const ios_base&);
>      ^
> 
> This is useful, it's the private operator= that was needed, but inaccessible.

Indeed! I was in a hurry, but this information should be in the "because
[reason]" part of my ideal output above. My point (and Ian's in comment #1) is
that the error is that the implicitly-defined methods cannot be called/created
(and this should be mentioned first) and the reason is that = is inaccessible
(and this should be mentioned later).

> In file included from /home/redi/gcc/4.x/include/c++/4.8.0/ios:45:0,
>                  from /home/redi/gcc/4.x/include/c++/4.8.0/istream:40,
>                  from /home/redi/gcc/4.x/include/c++/4.8.0/fstream:40,
>                  from f.cc:1:
> /home/redi/gcc/4.x/include/c++/4.8.0/bits/basic_ios.h:64:11: error: within this
> context
>      class basic_ios : public ios_base
>            ^
> 
> The caret diagnostic is useless here, because an implictly-defined function has
> no location.

No, the location is useless (or the error is wrongly stated). The caret just
shows where the error message is pointing to the user. And also, it should not
be an error, but a note.


      parent reply	other threads:[~2012-04-16 11:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-39728-4@http.gcc.gnu.org/bugzilla/>
2012-04-15 17:07 ` manu at gcc dot gnu.org
2012-04-16 10:45 ` redi at gcc dot gnu.org
2012-04-16 10:54 ` manu at gcc dot gnu.org
2012-04-16 11:11 ` redi at gcc dot gnu.org
2012-04-16 11:34 ` manu at gcc dot gnu.org [this message]

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-39728-4-mg0ij2ef4G@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).