This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/48101] obscure error message with std::set<const int>
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 13 Mar 2011 12:24:15 +0000
- Subject: [Bug libstdc++/48101] obscure error message with std::set<const int>
- Auto-submitted: auto-generated
- References: <bug-48101-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48101
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-13 12:24:13 UTC ---
Do you have a suggestion for a better error? We could use a static_assert in
std::allocator to reject const T
As far as I can see, the reason the code is invalid is exactly the reason
given: std::allocator can't be instantiated with const T. I don't think it's
invalid to default construct a set::set with a const value_type, as long as
don't use std::allocator.