https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88802

            Bug ID: 88802
           Summary: std::hash<std::nullptr_t> not implemented
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tom at kera dot name
  Target Milestone: ---

See https://stackoverflow.com/q/54147254/560648.

C++17 requires that std::hash<std::nullptr_t> be provided. MSVS does, but dev
libstdc++ doesn't (and neither does libc++). This seems to be the case on trunk
still.


#include <functional>
int main()
{
    std::hash<std::nullptr_t> h;
    return h(nullptr);
}


Result:

main.cpp: In function 'int main()':
main.cpp:4:31: error: use of deleted function
'std::hash<std::nullptr_t>::hash()'
     std::hash<std::nullptr_t> h;


Expected result:

Good build and some return code.

Reply via email to