[llvm-bugs] [Bug 47624] New: DenseMap and StringMap can't be used in range for under c++20

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 23 04:11:48 PDT 2020


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

            Bug ID: 47624
           Summary: DenseMap and StringMap can't be used in range for
                    under c++20
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Core LLVM classes
          Assignee: unassignedbugs at nondot.org
          Reporter: N.James93 at hotmail.co.uk
                CC: llvm-bugs at lists.llvm.org

Using llvm::DenseMap and llvm::StringMap in external projects compiled with
c++20 results in error when comparing their iterators

Iterating over a `const DenseMap&` causes no issues. However There are issues
with iterating over a non const DenseMap. With StringMap there are issues no
matter what kind of reference the StringMap is.

using clang-10 as the host compiler, warnings for StringMap can be supressed
with `-Wno-ambiguous-reversed-operator` however this has no effect on
supressing the DenseMap warnings. That has been addressed in clang-11 which
will suppress all these warnings

See example here
https://godbolt.org/z/Keqa1n
Note this is compiling with a trunk build of clang so some of these warnings
could change down the line, the warnings emitted for clang-10.0.1 will stay
consistent though

-- 
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/20200923/43483908/attachment.html>


More information about the llvm-bugs mailing list