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

            Bug ID: 49628
           Summary: Static analyzer false positive InnerPointer with
                    std::data() from C++17
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: dcough...@apple.com
          Reporter: dm...@hotmail.com
                CC: dcough...@apple.com, llvm-bugs@lists.llvm.org

The following C++17 code falsely triggers InnerPointer.

#include <string>

int main()
{
    auto s = std::string("abc");
    auto p = data(s);     // this triggers the warning
    // auto p = s.data(); // this is OK
    p[1] = 'Z';
}

std::data() is a very simple addition to C++17,
https://en.cppreference.com/w/cpp/iterator/data

-- 
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