<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56255>56255</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
WhitespaceSensitiveMacros fails when used with IndentPPDirectives
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
BradL-Msft
</td>
</tr>
</table>
<pre>
sample code using stringize operator (`#`)
```c
// Allow the command line to specify a "profile" file
#if 1
#define PROFILE_QUOTE(IDxxxX) #IDxxxX
#define PROFILE_INCLUDE(abcdef) PROFILE_QUOTE(abcdef)
#endif
#define PROFILE_QUOTE2(IDxxxX) #IDxxxX
#define PROFILE_INCLUDE2(abcdef) PROFILE_QUOTE2(abcdef)
```
clang-format command & version
```
c:\clangerror>clang-format --version
clang-format version 12.0.0
c:\clangerror>clang-format --style="{IndentPPDirectives: AfterHash, WhitespaceSensitiveMacros: ['PROFILE_QUOTE', 'PROFILE_QUOTE2']}" sample.h
```
result:
```
// Allow the command line to specify a "profile" file
#if 1
# define PROFILE_QUOTE(IDxxxX) # IDxxxX
# define PROFILE_INCLUDE(abcdef) PROFILE_QUOTE(abcdef)
#endif
#define PROFILE_QUOTE2(IDxxxX) #IDxxxX
#define PROFILE_INCLUDE2(abcdef) PROFILE_QUOTE2(abcdef)
```
Expected:
`PROFILE_QUOTE` is indented under the `#if`, but the actual definition of the macro `#IDxxxX` is untouched.
I understand the intent of WhitespaceSensitiveMacros to NOT modify the DEFINITION of the macro. Please let me know if I misunderstand the purpose, thanks.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9VVtvmzAU_jXk5SiImJDLAw9pLhpSl2Rbq-1tcuAQvBoc2aZN9-t3DGnWpIk2TVMlZHN8_H0-l8-wUdlzbHi5kwipyhBqI6otGKtpEj8R1A41t0qDx0beIPBY2IxjL5h5weQw0krzpAebLeiBiZTqCWzhmMuSVxlIUSFYBWaHqcifgRMr22mVC4n0Bs18oAhFDr2jkWHusOvPq0VyO__-6X51N6eIktl-v_9G4QAQVXgwr4CS5fT2fuZgfJOSz8HOCY-eIwlWmchPsr0cDfvHcNj1eNiFgF5K3Zqp5NW2mytdcnussscG8IjaCFVdBnnhxIumDRa1VtoL5ydE3e4J_MR38ECP-YEfvK7LX9Aa-0wNDmfUa294k1QZVna9ngmNqRWPaIgBJrlF_YGbwmNT-FoIi2bHU_yClRFu00eeatXs9KIbjw3POjh0sPNl5tajmTd0J0Mrd7-4WJx21GhqaV1CF_f8f30D_FHhza4zSb2BvafG30Xh8z3V0mL2uhenCQ0CEAZEIybMoKYX3XSl_VxRYm6ewqa2zTJPbc1lWzhSFGlZ5Y2jdMo6oA6Jtdx1ZVWdFpj5r2uUtEcZ6zrv8ILOr6xjuypbJ47l6g5KlTl9ONRsvkiWyV2yWp7E4QOsJXKDINFCifBQkdhIMwmUwpydvKv1Thl0WdqCVw_mJNBOFofZOBzzjhVWYnw9upwLaeCpwIr-A1TLJ2ELeHtNO7WWcWHtzl3D9jJsaWe98ekikCHl48vUJfX_IBiZwpiarjhbRAMWRZ0iDlk-5ixMN_1-hAHmwYAU1ItGY5LEgEe8I_kGpYmbe84qpPQdhft4RLOOiFnAGGFGQY_1wp4_zHE4Gucp70e90TBCrx9gSQn5Lg5f6W1Hx01Im3pryCmFsea3kxsjthVicxzx89oWSsc3mme33Y8mt53m9LiJ_hd8zi4y">