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

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] Bad syntax with QualifierAlignment and typename
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          sfc-gh-sgiesecke
      </td>
    </tr>
</table>

<pre>
    Code containing `typename` and qualifiers is formatted wrongly with `QualifierAlignment`, resulting in broken syntax.

For example:
```
$ echo "template<typename T> typename T::type const& foo(T x) { x.template get<typename T::type   const &>();}" | clang-format --style="{QualifierAlignment: Left}"
template <typename T> typename T::const type &foo(T x) {
  x.template get<typename T::const type &>();
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFktuOmzAQhp_G3IxAxhySXHCRQ3PVm0r7AgYGcNfYKTZN8vYdw2a72VZayQKP7fnn-8eubXuvjrZFaKzxUhllemAl9_cLGjkiTUGaFn7NUqtO4eRAOejsNErvsYXrZE2v73BVfgh5Px7n9lr1ZkTjaZGJI0zoZu2DujJQT_YVDbg7lbwljJ8Y36_fs50Ab3K8aGTZ21pQWMcaihywGSwwITzSSenp7PFBDC8s-wYfoz2NEAeLzjNREr9lYvsCNyZ2wDYHuCUPJejRf1J7z4dVgQqXVIMUKJ1lB7Y5EQrpHKHR0vTx2h6IY-fvwUfYpir_6U22h-_Y-VVhtfcO8qWnFWYhI6LPnlY1-Nras8yTsbXfBPd8D1FbZe0u28nIK6-xYsXho3FWnOAg27frXZ_Gv96XZ_VgieZJV4P3FxeYxJlGT2lznTR2pEDr349ffJnsT2zoHs_KuRkdTYpis0ujoUqbfJunyDOZI5ctF1lWlqJGzNq87WqMtKxRuwBM_TZ4hUUi9L44RaoSXAheZCnf8bzIkxS327SVKeei4JuyYznHUSqdBI7ETn00VQtSPfeONrVy3v3dlM6RV1z6E_Tl7Ac7Va5r4n6IXa_QYfOK0cJQLR7-AIdfHfk">