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

    <tr>
        <th>Summary</th>
        <td>
            clang-format misaligns comments when indenting preprocessor directives with BeforeHash
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          BradL-Msft
      </td>
    </tr>
</table>

<pre>
    Seems like clang-format is attempting to align comments with a `#define`, but incorrectly uses IndentWidth instead of PPIndentWidth if they differ.

Example:

Output:
```
#if 1
// not a define comment
int x = 3;
    // some comments
    // another
  #define foo 1
  #define vbarrr 2
  #define something_else_very_long
#endif
```

Format:
```
---
Language:        Cpp
BasedOnStyle: LLVM
IndentPPDirectives: BeforeHash
IndentWidth: 4
PPIndentWidth: 2
...
```

Input Source:
```C
#if 1
// not a define comment
int x = 3;
// some comments
// another
#define foo 1
#define vbarrr 2
#define something_else_very_long
#endif
```


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytU8FuozAQ_Rq4jIIAA5scODTJVlspVSNV2j1WBsbgXWMj22Sbv1-DS5sq7Z5qWWDP84xn3vNUqjmXj4i9AcH_INSCynbFlO6pBW6AWov9YLlswSqggrcSatX3KK2Bv9x2QCEo4iAlDTIucV7voBqdt6yV1lhbcYbRoIE72Ti3X7xxXlwai7QBxeB4fAcwsB2eoeGMoY6CeB_EN_77_Zn2g8CA3FxaH0Y7jPbN6BLw029T4iImy-bWTZDKuqx9vksx_gCXFp4hIHsgAdl6G7jx4mhU_-pgrlDq4naoF_srJcCUWjK4NJ8qqrWG9BqZ7rGd4_wJhcGnE-rzk1CyfS0JpaPn43rn7-2s32ecrFYrvzg4rUfaTozCy9gNg8e21GDzIB_teWYcDoef9x7xah2Pez6Jy09oJnyL7tHgD2q6y1OzphOcees7rSf7S_VRFP2nnDvpFIZHNeoar4vafZXSn6v8kcIf6vuZul-obdiUpNmQDQ0ttwLLdx3bczP3qLlo0g6la7eJ9amLB42DVjUao7RrskVC38tvIoajFmVn7TCJ68tv3YmxilxgtxHitPxWLt5vF8ZtuTGjew7pbV6QtAi7khVIiyxhjOZ5HWOTsbRZUywYIWRdrfNQ0MrxUAb5Nsj3IS_TOE3jb3ESk2SdZ1GSZJt4vcmTjLGqyNZBFmNPuYimiyOl21CXcw7V2BoHCm6seQOpMY4MxCU-HW2ndLnVtDms7g2z4ZxxOaf7D6zzhHo">