[cfe-dev] clang-tidy not running

Daniel Dilts via cfe-dev cfe-dev at lists.llvm.org
Mon Nov 9 15:54:45 PST 2015


On Mon, Nov 9, 2015 at 3:34 PM, Daniel Dilts <diltsman at gmail.com> wrote:

> I am trying to get a custom tool to work, but it seems that learning why I
> can't get clang-tidy to work would be a good first step.
>
> I have a file named x.cpp with the following content:
> #include <vector>
> std::vector<int> v;
>
> int Func(int i, int j);
>
>
> I compile it from a Windows command prompt with this:
> clang-cl -c -fms-compatibility-version=19 x.cpp
>
> No errors, warnings, etc. are emitted, and the .obj is created.
>
> I then attempt to run clang-tidy with this:
> clang-tidy x.cpp -- clang-cl -c -fms-compatibility-version=19 x.cpp
>
> This gives me the error:
> error: 'vector' file not found [clang-diagnostic-error]
>
> I installed with the installer built today (November 9th).
> clang-tidy -version
> LLVM (http://llvm.org/):
>   LLVM version 3.8.0-r252455
>   DEBUG build with assertions.
>   Built Nov  9 2015 (04:27:14).
>   Default target: i686-pc-windows-gnu
>   Host CPU: sandybridge
>
> Does anyone know what I missed?  I thought that the arguments after '--'
> could be used instead of a compilation database.
>

While I have found that passing the triple to clang-tidy works (clang-tidy
x.cpp -- -target x86_64-pc-windows-msvc19.0.0 -c x.cpp), I am still curious
as to why it didn't work passing the compiler command-line.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151109/c25e9717/attachment.html>


More information about the cfe-dev mailing list