[analyzer][StdLibraryFunctionsChecker] Do not match based on the restrict qualifier...
authorGabor Marton <gabor.marton@ericsson.com>
Thu, 3 Sep 2020 17:08:54 +0000 (19:08 +0200)
committerGabor Marton <gabor.marton@ericsson.com>
Fri, 4 Sep 2020 09:48:38 +0000 (11:48 +0200)
commitfe0972d3e4a65b4c5f5fa602b17ad30e463050b3
treeb6abbfefc85457fc6982bd0ce478d5eb3c803013
parenta633da5391b0e42c0185132e8b532ae9bc34489f
[analyzer][StdLibraryFunctionsChecker] Do not match based on the restrict qualifier in C++

The "restrict" keyword is illegal in C++, however, many libc
implementations use the "__restrict" compiler intrinsic in functions
prototypes. The "__restrict" keyword qualifies a type as a restricted type
even in C++.
In case of any non-C99 languages, we don't want to match based on the
restrict qualifier because we cannot know if the given libc implementation
qualifies the paramter type or not.

Differential Revision: https://reviews.llvm.org/D87097
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
clang/test/Analysis/std-c-library-functions-restrict.c [new file with mode: 0644]
clang/test/Analysis/std-c-library-functions-restrict.cpp [new file with mode: 0644]