[cfe-dev] Possible false-positive - clang static analyzer and regex

Lev Stipakov via cfe-dev cfe-dev at lists.llvm.org
Fri Jan 20 04:21:24 PST 2017


Hello,

A colleague sees a strange warning by clang static analyzer (actually from
clang-check, which is run on top of compilation database created by cmake).

This code:

#include <regex>

int main() {
    std::regex_match("jee", std::regex("lol"));
    return 0;
}

produces analyzer warning:

/usr/local/clang+llvm-3.9.0-x86_64-apple-darwin/bin/../include/c++/v1/regex:5724:17:
warning: Called C++ object pointer is null s.__node_->__exec_split(true,
s); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated.

What is wrong here?

-- 
-Lev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170120/f63016ea/attachment.html>


More information about the cfe-dev mailing list