<div dir="ltr"><div class="gmail_extra">This is interesting:</div><div class="gmail_extra">  Default target: i686-pc-windows-gnu<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">So, Clang thinks it's targetting mingw by default and does a mingw header file search instead of doing an MSVC header file search. I now recall that Hans builds the <a href="http://llvm.org">llvm.org</a> releases with an explicit default target of i686-pc-windows-gnu, so that clang[++].exe behaves like mingw and clang-cl.exe behaves like cl.exe. clang-tidy inherits the default from clang, and clang-cl explicitly overrides the default target to MSVC.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I'm not sure we actually want this behavior anymore. These days, I think of clang-cl as a command line syntax adapter, with clang.exe providing access to all the same functionality. At least, having the behavior of the installer differ from that of a stock cmake build feels a bit surprising.</div><div class="gmail_extra"><br></div><div class="gmail_extra">This command line works, as well as the explicit -target override as you found:</div><div class="gmail_extra">"C:\Program Files (x86)\LLVM\bin\clang-tidy.exe" t.cpp -- --driver-mode=cl -c t.cpp -fms-compatibility-version=19</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 9, 2015 at 3:34 PM, Daniel Dilts via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div>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.<br></div></div><div><br></div><div>I have a file named x.cpp with the following content:</div><div>#include <vector><br>std::vector<int> v;</div><div><br></div><div>int Func(int i, int j);</div><div><br></div><div><br></div><div>I compile it from a Windows command prompt with this:</div><div>clang-cl -c -fms-compatibility-version=19 x.cpp</div><div><br></div><div>No errors, warnings, etc. are emitted, and the .obj is created.</div><div><br></div><div>I then attempt to run clang-tidy with this:</div><div>clang-tidy x.cpp -- clang-cl -c -fms-compatibility-version=19 x.cpp</div><div><br></div><div>This gives me the error:</div><div>error: 'vector' file not found [clang-diagnostic-error]</div><div><br></div><div>I installed with the installer built today (November 9th).</div><div>clang-tidy -version</div><div>LLVM (<a href="http://llvm.org/" target="_blank">http://llvm.org/</a>):<br>  LLVM version 3.8.0-r252455<br>  DEBUG build with assertions.<br>  Built Nov  9 2015 (04:27:14).<br>  Default target: i686-pc-windows-gnu<br>  Host CPU: sandybridge</div><div><br></div><div>Does anyone know what I missed?  I thought that the arguments after '--' could be used instead of a compilation database.</div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div>