This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/51558] Declaration of unspecialized std::hash<_Tp>::operator()(_Tp) turns compile-time errors into link-time errors
- 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: Thu, 15 Dec 2011 02:01:24 +0000
- Subject: [Bug libstdc++/51558] Declaration of unspecialized std::hash<_Tp>::operator()(_Tp) turns compile-time errors into link-time errors
- Auto-submitted: auto-generated
- References: <bug-51558-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51558
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-12-15 02:01:24 UTC ---
Would the condition of the static_assert need to depend on the template
parameter somehow, to avoid the case where no valid specialization can ever be
generated? (Which would be ill-formed, no diagnostic required, by [temp.res]
p8.)
e.g.
static_assert( integral_constant<int, sizeof(_Tp)>::value,
"std::hash must be specialized for this type" )