<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64144>64144</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang-scan-deps crashes when input file does not exist
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          namniav
      </td>
    </tr>
</table>

<pre>
    Simple repro:
```
clang-scan-deps --format=p1689 -- `which clang++` --std=c++20 this-file-does-not-exist.cpp
```

Result:
> ```
> error: no such file or directory: 'this-file-does-not-exist.cpp'
> error: no input files
> PLEASE submit a bug report to https://github.com/Homebrew/homebrew-core/issues and include the crash backtrace.
> Stack dump:
> 0. Program arguments: clang-scan-deps --format=p1689 -- /opt/homebrew/opt/llvm/bin/clang++ --std=c++20 this-file-does-not-exist.cpp
> Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
> 0  libLLVM.dylib 0x0000000114052494 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
> 1  libLLVM.dylib            0x0000000117e9d550 SignalHandler(int) + 304
> 2  libsystem_platform.dylib 0x000000019880d4c4 _sigtramp + 56
> 3 clang-scan-deps          0x0000000102c4aae4 main + 5448
> 4  dyld 0x0000000102df1088 start + 516
> [1]    25079 segmentation fault  clang-scan-deps --format=p1689 -- /opt/homebrew/opt/llvm/bin/clang++ 
> ```

Version info:
> ```
> $ clang-scan-deps --version
> Homebrew LLVM version 16.0.6
>   Optimized build.
> ```

I can reproduce this with non-Homebrew builds, so I report here instead to Homebrew.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VV9vo7gX_TTOyxXIGEPggYf010at1NFU09FIv32pDL4B7xgb2SadzKdfmbRN-mdnVitthBDB955zfO_1QXiveoPYkOKCFJcrMYfBusaI0SixX7VWHpp7NU4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