[llvm-bugs] [Bug 41360] New: Set of pointer to incomplete type gives wrong warning message.

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Apr 3 06:46:59 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41360

            Bug ID: 41360
           Summary: Set of pointer to incomplete type gives wrong warning
                    message.
           Product: libc++
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mclow.lists at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

The following two bits of code give very odd error messages
(code/report from Jonathan Wakely via IRC)

#include <set>

struct Base { };
struct Derived; // derives from Base, but incomplete at this point

int main()
{
  std::set<Derived*, std::less<Base*>> s;
};


== and ==

#include <set>

struct Base { };
struct Derived; // derives from Base, but incomplete at this point

template<typename T>
struct X
{
  std::set<Derived*, std::less<Base*>> s;
};

The error message is:

/Sources/LLVM/llvm-project/libcxx/include/set:453:26: warning: the specified
comparator type does not provide a const
      call operator [-Wuser-defined-warnings]

This is also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85965

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190403/43280c3e/attachment-0001.html>


More information about the llvm-bugs mailing list