<div dir="ltr"><div>The main function for my custom tool looks like this:</div><div>CommonOptionsParser optionsParser(argc, argv, gMyToolCategory);<br>RefactoringTool tool(optionsParser.getCompilations(), optionsParser.getSourcePathList());<br>MyToolActionFactory factory{tool};<br>auto a = tool.runAndSave(&factory);</div><div><br></div><div>In ClangTool::run(), when I get to the line "assert(!CommandLine.empty());" I see that the CompileCommand and CommandLine variables in my custom tool match those from clang-tidy built from the same source.  The only difference is CommandLine[0], which names my tool rather than clang-tidy.</div><div><br></div><div>What is confusing me is that the behavior of Invocation.run() differs between the two programs.  In clang-tidy it runs perfectly (no warnings, no errors).  In my tool I get a lot of errors of the form:</div><div>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\immintrin.h(764,28) :  error:<br>      invalid token in macro parameter list<br>#define _mm256_loadu2_m128(/* float const* */ hiaddr, \</div><div><br></div><div>It seems that there must be something that I am missing when checking to see if my program is executing in a similar manner to clang-tidy.  What other variables, functions, etc. should I check to try to debug my problem?</div></div>