[all-commits] [llvm/llvm-project] fe0972: [analyzer][StdLibraryFunctionsChecker] Do not matc...

Gabor Marton via All-commits all-commits at lists.llvm.org
Fri Sep 4 02:49:03 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: fe0972d3e4a65b4c5f5fa602b17ad30e463050b3
      https://github.com/llvm/llvm-project/commit/fe0972d3e4a65b4c5f5fa602b17ad30e463050b3
  Author: Gabor Marton <gabor.marton at ericsson.com>
  Date:   2020-09-04 (Fri, 04 Sep 2020)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
    A clang/test/Analysis/std-c-library-functions-restrict.c
    A clang/test/Analysis/std-c-library-functions-restrict.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list