[llvm-bugs] [Bug 32295] New: missing const qualifier in two DenseSetImpl overloaded operators (Clang build fails)

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 15 18:02:49 PDT 2017


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

            Bug ID: 32295
           Summary: missing const qualifier in two DenseSetImpl overloaded
                    operators (Clang build fails)
           Product: new-bugs
           Version: 4.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: herrameise at gmail.com
                CC: llvm-bugs at lists.llvm.org

The overloaded indirection operators ("*" and "->") for the DenseSetImpl class
are missing "const" qualifiers. Interestingly, this does not affect building
LLVM itself, but it will cause the Clang build to fail in Visual Studio 2015,
Visual Studio 2017, and possibly other toolchains.


FIX: "llvm-4.0.0.src/include/llvm/ADT/DenseSet.h"
- 106    ValueT &operator*() { return I->getFirst(); }
- 107    ValueT *operator->() { return &I->getFirst(); }
+ 106    ValueT &operator*() const { return I->getFirst(); }
+ 107    ValueT *operator->() const { return &I->getFirst(); }


It looks like someone actually brought this up on the mailing list in January
but didn't get any response
(http://lists.llvm.org/pipermail/llvm-dev/2017-January/108647.html), so
hopefully this makes it into the next bugfix release. I don't use LLVM on
Linux, so I'm not sure if that Clang build is also affected

-- 
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/20170316/b398d760/attachment.html>


More information about the llvm-bugs mailing list