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

    <tr>
        <th>Summary</th>
        <td>
            Clang analyzer incorrectly detects input file type
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    ```
scan-build: The analyzer encountered problems on some source files.
scan-build: Preprocessed versions of these sources were deposited in '/tmp/scan-build-2022-04-14-202208-1299136-1/failures'.
scan-build: Please consider submitting a bug report using these files:
scan-build:   http://clang-analyzer.llvm.org/filing_bugs.html
```

[Here is the aforementioned `failures` directory, plus the object file that was treated for some reason as a C++ input file.](https://github.com/llvm/llvm-project/files/8491489/bug.tar.gz)

Here is the invocation that caused the errors:

```bash
scan-build: Using '/usr/bin/clang-13' for static analysis
/usr/bin/../lib/clang/c++-analyzer  -Wall -pedantic -DBUILD_VERSION_STRING=\"`git describe --tags --dirty --always 2>/dev/null`\" `pkg-config --libs-only-L libpng` -o rgbgfx src/gfx/main.o src/gfx/pal_packing.o src/gfx/pal_sorting.o src/gfx/pal_spec.o src/gfx/process.o src/gfx/proto_palette.o src/gfx/reverse.o src/gfx/rgba.o src/extern/getopt.o src/error.o -O3 -flto -DNDEBUG -Wall -pedantic -std=c++17 -I include -D_POSIX_C_SOURCE=200809L -fno-exceptions -fno-rtti -x c++ src/version.c `pkg-config --libs-only-l libpng`
```

I can also provide more files as well as sources if desired.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVVMlu4zgQ_Rr5QlDQ5u2gQ8dKegwEcSPuzMzNoKiSzGmKFEjKjvvrpyg5djrxNDCAwK1U66t6pa5OeTCLzl9UBNEXy5miZS9kFaRfyPc9EKaYPP0EQ0Bx3SsHBirSGV1KaC3RiljdAi694UBqIcGGt0x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