[Bug libstdc++/70294] New: operator< and operator== for std::thread::id only findable by ADL

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Mar 18 13:42:00 GMT 2016


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

            Bug ID: 70294
           Summary: operator< and operator== for std::thread::id only
                    findable by ADL
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

#include <thread>
bool (*lt)(std::thread::id, std::thread::id) = &std::operator<;
bool (*eq)(std::thread::id, std::thread::id) = &std::operator==;

This fails because the friend functions in std::thread::id can't be found by
normal name lookup. There should be non-friend declarations at namespace scope.

I'll fix this post-gcc6.


More information about the Gcc-bugs mailing list