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

            Bug ID: 48011
           Summary: range-loop-analysis checks for trivial copyability,
                    rather than trivial copy-constructibility
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: dcough...@apple.com
          Reporter: jake.arkinst...@gmail.com
                CC: dcough...@apple.com, llvm-bugs@lists.llvm.org

On the Cpplang slack, user Wolle posted a curious warning that came from
range-loop-analysis.

Here's a minimal example: https://godbolt.org/z/1cxs43. Note that without the
copy assignment operator overload, the warning is not present.

The range-based for loop performs a copy construction, so that is what should
be checked for.

At https://clang.llvm.org/doxygen/SemaStmt_8cpp_source.html#l02824, the check
is on whether the type is trivially copyable, not whether it is trivially copy
constructible, which is a weaker requirement (but the relevant one in this
case). I am not intimately familiar with clang sourcecode, but I believe this
to be the cause of the warning.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to