<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/96476>96476</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang] Warning not displayed when using `-include`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
VitorRamos
</td>
</tr>
</table>
<pre>
## Description
While compiling a c++ source file with clang++ using the `-include` flag to include a header file, some warnings are not shown.
## Steps to Reproduce
1. header file `assert.h`:
```c++
#pragma once
#define CUSTOM_MACRO(expr) (void)(!!(expr))
```
2. cpp file `main.cpp` :
```c++
int main()
{
int x = 0;
CUSTOM_MACRO(x > 0 || x <= 0);
}
```
3. Compile the file with the following command:
```sh
clang++ -Wall -Wextra -include assert.h -c main.cpp
```
4. Observe that no warning is outputted.
5. Compile the file again with the additional `-save-temps=obj` flag:
```sh
clang++ -Wall -Wextra -include assert.h -c main.cpp -save-temps=obj
```
6. Observe that the following warning is generated:
```log
main.cpp:5:21: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare]
(void)(!!(x > 0 || x <= 0));
~~~~~~^~~~~~~~~
1 warning generated.
```
## Expected Behavior
The warning indicating that the comparison always evaluates to true should be displayed regardless of the use of the `-save-temps=obj` flag.
## Additional Information
- **Compiler Version:** Clang 16.0.0
- **Operating System:** Ubuntu 22.04
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVctu4zoPfhplQ9iw5UvihRdp0gL_YlCgnZkufzA2Y2sgS4YkJ-1mnv1AjhMnPenM5ghC64gX8SM_imitaBRRybIHlm0XOLhWm_KncNq8YKftYqfrj5LxhPEEtmQrI3ontGLRlkXr09-3VkiCSne9kEI1gFAx_sD4A1g9mIpg7-VH4VqoJKpmEg7WK7uWgOVRIFQlh5pYHsFeYgNOw3QECC1hTWb0w_gGrO4IjmiUUI0FNARKO7CtPqrwOrAp7FdHvfU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