[PATCH] D87097: [analyzer][StdLibraryFunctionsChecker] Do not match based on the restrict qualifier in C++

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 3 10:13:16 PDT 2020


martong created this revision.
martong added reviewers: balazske, steakhal, Szelethus, NoQ, vsavchenko, baloghadamsoftware, gamesh411.
Herald added subscribers: cfe-commits, ASDenysPetrov, Charusso, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity.
Herald added a project: clang.
martong requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87097

Files:
  clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
  clang/test/Analysis/std-c-library-functions-restrict.c
  clang/test/Analysis/std-c-library-functions-restrict.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87097.289752.patch
Type: text/x-patch
Size: 5563 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200903/765e372c/attachment.bin>


More information about the cfe-commits mailing list