clang-tidy crashes on windows when using /EHsc


(Disclaimer: I already posted this to cfe-users but it doesn’t seem to be very active so am reposting here. Apologies if this is considered spam)

I am using clang on Windows and can currently create an AST dump for a cpp file, which I am doing as follows:

clang-cl -Xclang -ast-dump foo.cpp [OPTIONS]

Where [OPTIONS] is the list of command line options used to compile with. However, when I try to use clang tidy, there is a pause where seemingly nothing happens and then I get a pop-up saying “clang has stopped working” and it crashes. I am calling clang-tidy with the following command:

clang-tidy foo.cpp – --driver-mode=cl [OPTIONS]

I tried removing options in [OPTIONS] one-by-one and it seems like part of the problem may be the option /EHsc because removing it stops this behaviour. I am finding it difficult to understand what the problem is exactly but I was wondering if I am even going about this the right way. The fact that I can produce an AST while using /EHsc has confused me. Any ideas people might have about what I’m doing wrong would be appreciated!