From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25461 invoked by alias); 13 Mar 2011 10:35:46 -0000 Received: (qmail 25320 invoked by uid 22791); 13 Mar 2011 10:35:45 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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, 13 Mar 2011 10:35:41 +0000 From: "gdr at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/48101] New: obscure error message with std::set X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gdr at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: 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 Date: Sun, 13 Mar 2011 10:35:00 -0000 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: 2011-03/txt/msg01306.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D48101 Summary: obscure error message with std::set Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: gdr@gcc.gnu.org The error message displayed on the following program is quite obscure and has no apparent relation with the actual error. Quite mystifying. #include int main() { std::set s; } With my system compiler (GCC-4.5), I get: In file included from /usr/include/c++/4.5/x86_64-suse-linux/bits/c++allocator.h:34:0, from /usr/include/c++/4.5/bits/allocator.h:48, from /usr/include/c++/4.5/bits/stl_tree.h:63, from /usr/include/c++/4.5/set:60, from b.C:1: /usr/include/c++/4.5/ext/new_allocator.h: In instantiation of =E2=80=98__gnu_cxx::new_allocator=E2=80=99: /usr/include/c++/4.5/bits/allocator.h:87:5: instantiated from =E2=80=98std::allocator=E2=80=99 /usr/include/c++/4.5/bits/stl_set.h:90:61: instantiated from =E2=80=98std= ::set=E2=80=99 b.C:4:24: instantiated from here /usr/include/c++/4.5/ext/new_allocator.h:79:7: error: =E2=80=98const _Tp* __gnu_cxx::new_allocator<_Tp>::address(const _Tp&) const [with _Tp =3D cons= t int, const _Tp* =3D const int*, const _Tp& =3D const int&]=E2=80=99 cannot be ov= erloaded /usr/include/c++/4.5/ext/new_allocator.h:76:7: error: with =E2=80=98_Tp* __gnu_cxx::new_allocator<_Tp>::address(_Tp&) const [with _Tp =3D const int,= _Tp* =3D const int*, _Tp& =3D const int&]=E2=80=99 Go and figure out what the actual error was (hint: use of 'const int') when the compiler displays internals of libstdc++ with unoverloadable address of operator (which the user never overloaded in the first place.) -- Gaby