[cfe-users] [clang-tidy] modernize-make-unique not working on Mac OS?
Tetsuo Kiso via cfe-users
cfe-users at lists.llvm.org
Sat Mar 18 23:40:09 PDT 2017
Hello,
On Mac OS X 10.12.3, I’m trying to use clang-tidy, part of LLVM 4.0.0
(I installed LLVM 4.0.0 using Homebrew.)
It seems "clang-tidy -checks=modernize-make-unique" doesn’t work on Mac OS.
I’m not sure I’m using clang-tidy and its options correctly, though.
Here is the version of clang-tidy I’m using, sample code, the command I ran and output:
$ /usr/local/opt/llvm/bin/clang-tidy -version
LLVM (http://llvm.org/):
LLVM version 4.0.0
Optimized build.
Default target: x86_64-apple-darwin16.4.0
Host CPU: skylake
$ cat unique_ptr.cc
#include <memory>
class A {};
int main() {
auto ptr = std::unique_ptr<A>(new A);
return 0; } $ /usr/local/opt/llvm/bin/clang-tidy '-checks=-*,modernize-*' unique_ptr.cc -- -std=c++14 -I/usr/local/opt/llvm/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include
921 warnings generated.
Suppressed 921 warnings (921 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
I briefly skimmed the source of clang-tidy, but didn’t find the code to
turn the modernization off particularly for Mac OS.
Any help would be appreciated.
Tetsuo
More information about the cfe-users
mailing list