8

A colleague sees a strange warning by clang static analyzer (actually from clang-check).

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 going on here?

CinCout
  • 9,486
  • 12
  • 49
  • 67
lstipakov
  • 3,138
  • 5
  • 31
  • 46
  • 2
    Seeing the same issue, unable to find a fix right now, other than masking it out with `#ifndef __clang_analyzer__`. I'm seeing this on Xcode 8.3 (8E162) – WDUK Apr 03 '17 at 15:52
  • I am also seeing this with a call to regex_search() https://gist.github.com/anonymous/0341288f623b6252df8534fd1bdc8d3f – radj Apr 10 '17 at 06:40

0 Answers0