From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32279 invoked by alias); 15 Apr 2012 17:07:00 -0000 Received: (qmail 32271 invoked by uid 22791); 15 Apr 2012 17:06:58 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 15 Apr 2012 17:06:45 +0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/39728] diagnostic for private operator= is voluminous and unhelpful Date: Sun, 15 Apr 2012 17:07:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Last reconfirmed CC Ever Confirmed Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg01183.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D39728 Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2012-04-15 CC| |manu at gcc dot gnu.org, | |paolo.carlini at oracle dot | |com Ever Confirmed|0 |1 --- Comment #2 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez 2012-04-15 17:05:31 UTC --- This is what Clang prints: In file included from pr39728.C:1: In file included from /usr/include/c++/4.3/fstream:44: In file included from /usr/include/c++/4.3/istream:44: In file included from /usr/include/c++/4.3/ios:49: In file included from /usr/include/c++/4.3/bits/basic_ios.h:474: /usr/include/c++/4.3/bits/basic_ios.tcc:182:25: error: 'operator=3D' is a p= rivate member of 'std::ios_base' extern template class basic_ios; ^ /usr/include/c++/4.3/bits/ios_base.h:785:5: note: declared private here operator=3D(const ios_base&); ^ /usr/include/c++/4.3/iosfwd:57:11: note: implicit default copy assignment operator for 'std::basic_ios' first required here class basic_istream; ^ /usr/include/c++/4.3/bits/fstream.tcc:914:25: note: implicit default copy assignment operator for 'std::basic_istream' first required here extern template class basic_ifstream; ^ /usr/include/c++/4.3/bits/fstream.tcc:913:25: error: 'operator=3D' is a pri= vate member of 'std::basic_streambuf' extern template class basic_filebuf; ^ /usr/include/c++/4.3/streambuf:782:7: note: declared private here operator=3D(const __streambuf_type&) { return *this; }; ^ /usr/include/c++/4.3/bits/fstream.tcc:914:25: note: implicit default copy assignment operator for 'std::basic_filebuf' first required here extern template class basic_ifstream; ^ pr39728.C:10:5: note: implicit default copy assignment operator for 'std::basic_ifstream' first required here y =3D x; ^ 2 errors generated. Even with canonicalized paths, GCC diagnostic is awful. Several things wron= g: * Do not show "In member function", it clutters the output and it is duplic= ated info because they are already mentioned in the note.=20 * What is a "synthesized method"? Where this term comes from? Is this somet= hing that an average C++ programmer can understand? * Avoid monsters like "std::basic_streambuf<_CharT, _Traits>::__streambuf_t= ype& std::basic_streambuf<_CharT, _Traits>::operator=3D(const __streambuf_type&)= [with _CharT =3D char; _Traits =3D std::char_traits; std::basic_streambuf<_= CharT, _Traits>::__streambuf_type =3D std::basic_streambuf]" Following Ian's suggestion, it would be amazing if GCC emitted: pr39728.C:10:5: error: cannot call implicit default copy assignment operator for 'std::basic_ifstream' note: candidates are: /usr/include/c++/4.3/streambuf:782:7: note: candidate #1 is implicit default copy assignment operator for 'std::basic_filebuf' [...............] note: cannot be called because [reason] /usr/include/c++/4.3/streambuf:782:7: note: candidate #1 is implicit default copy assignment operator for 'std::basic_filebuf' [...............] note: cannot be called because [reason] /usr/include/c++/4.3/bits/fstream.tcc:914:25: note: candidate #2 is implicit default copy assignment operator for 'std::basic_istream' [...............] note: cannot be called because [reason] I am sorry, I don't have time to fix all this, but I wish we had enough developers to fix it, because it is a shame.