This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/48101] New: obscure error message with std::set<const int>


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

           Summary: obscure error message with std::set<const int>
           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 <set>

int main() {
  std::set<const int> 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
â__gnu_cxx::new_allocator<const int>â:
/usr/include/c++/4.5/bits/allocator.h:87:5:   instantiated from
âstd::allocator<const int>â
/usr/include/c++/4.5/bits/stl_set.h:90:61:   instantiated from âstd::set<const
int>â
b.C:4:24:   instantiated from here
/usr/include/c++/4.5/ext/new_allocator.h:79:7: error: âconst _Tp*
__gnu_cxx::new_allocator<_Tp>::address(const _Tp&) const [with _Tp = const int,
const _Tp* = const int*, const _Tp& = const int&]â cannot be overloaded
/usr/include/c++/4.5/ext/new_allocator.h:76:7: error: with â_Tp*
__gnu_cxx::new_allocator<_Tp>::address(_Tp&) const [with _Tp = const int, _Tp*
= const int*, _Tp& = const int&]â


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]