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

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] Spurious clang-diagnostic-unused-macros report
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          alejandro-colomar
      </td>
    </tr>
</table>

<pre>
    ```c
$ cat header.h
#ifndef HEADER_H
#define HEADER_H

void foo(void);

#endif  // HEADER_H
```
```sh
$ gcc -Wall -Wextra header.h
```
```sh
$ clang -Weverything header.h 
```
```c
$ clang-tidy -checks=* --use-color header.h --
1 warning generated.
/home/alx/tmp/header.h:1:9: warning: header guard does not follow preferred style [llvm-header-guard]
#ifndef HEADER_H
 ^~~~~~~~
        HOME_ALX_TMP_HEADER_H
```
```c
$ clang-tidy -checks=* --use-color header.h -- -Weverything
2 warnings generated.
/home/alx/tmp/header.h:1:9: warning: header guard does not follow preferred style [llvm-header-guard]
#ifndef HEADER_H
 ^~~~~~~~
        HOME_ALX_TMP_HEADER_H
/home/alx/tmp/header.h:2:9: warning: macro is not used [clang-diagnostic-unused-macros]
#define HEADER_H
        ^
```

As you can see, when compiling a header file, neither gcc nor clang report issues with its header guard macro being unused.  However, clang-tidy, when told to pass -Weverything to clang, somehow triggers a warning.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcVUGPqzYQ_jXmMgKBCUk4cGCboBz61Kqt9HqLjD2AX42NbLPZXPrbKyBsdqPVdqXeakWOM575_M03Y4c5J1uNWJDsiWSHgI2-M7ZgCn8wLawJuVGmZzaojbgWZBsvH07iA4lLQjfAmYcOmUAbdas1lY0W2MDpWB6Ov51Pr3aBjdT4aJ_nZyMFNMYQup-WhOYkfXrrQGiKWsgGgNCK0OoRZeX28NN1d64t5xB-Z0pB-B1fvGWPzL-AwRXT7RT_jPbqO6nbVxD4HIU_gIReiiuEvEP-lyPpgdASwnB0OItu77BhuEQmcGFWTye2qNEyjyJaMavO9EhoxdQLoZXvh8m0JpeWCUnLnKTlijAtl21oR2YFCIMOtPHQGKXMBQaLDVqLApy_KgSSPSn13IdLUDgHkezwecWBZMe_l3Ez3Mbpl2_Hc_nzn-c_vv16_lod_4N676q1wNBVCPe_1vLfUqEfpNIzbg3IJYPRoZj4LpILyVptnJc8HPW0Fc7O7i35D6_4ypVkx4-rPM-lg6sZgTMNDpHQn-DSoQZu-kGqqe3X-wqNVPO-Rum7SXfOQRt7u5wWB2M9SOdGdHCRvgPp3fsaLVnWOMEuuUQAJ3OZGmVCvvfYKw9vlABvYGDOvX8AvFn8J1dneuzMBbyVbYvWAVvFjQJRpCJPcxZgkWx3SbqlKd0HXbHfbeJ4K7hoRJMkoo6TjRA7scvTPYu3TR3IgsaUJjTZJ0my3-wjzvMdr-tYIN-KnFKyibFnUkVTY0XGtsGcfZHl2Y4GitWo3PrG22LuvnpsHdnESjrv7mFeejX_G7wRIDvA78NopRkdfN4IN-mD0aqi835wJC2X17qVvhvriJue0Go67fYVDtb8QO4JrZZ6EVrNpP8JAAD__w3HBF4">