I installed LLVM on MacOS 10.13 using homebrew:
brew install --with-toolchain llvm
Then I exported required variables, based on this guide.
export PATH="/usr/local/opt/llvm/bin:$PATH"
export CC=/usr/local/opt/llvm/bin/clang
export CXX=/usr/local/opt/llvm/bin/clang++
export LLVM_OPTIONS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib "\
"-I/usr/local/opt/llvm/include -I/usr/local/opt/llvm/include/c++/v1/"
When running clang-tidy:
clang-tidy myheaderlib.h -- $LLVM_OPTIONS
I get errors, all of them are related to standard files:
/usr/local/opt/llvm/include/c++/v1/iosfwd:96:1: error: unknown type name '_LIBCPP_BEGIN_NAMESPACE_STD'
/usr/local/opt/llvm/include/c++/v1/iosfwd:100:1: error: unknown type name 'template'
...
What may be the cause?