<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54888>54888</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] command line parameter -lines ignored when using QualifierAlignment
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
my-name-is-already-taken
</td>
</tr>
</table>
<pre>
When using the `QualifierAlignment` option, clang-format ignores the command line parameter `-lines`.
Example:
```
// test.cpp
void foo(const int& value){
// do something
}
void bar(const int& value){
// do another thing
}
```
This results in
```
> clang-format test.cpp -lines=2:2 -style="{Language: Cpp, QualifierAlignment: Right}"
// test.cpp
void foo(int const &value) {
// do something
}
void bar(int const &value) {
// do another thing
}
```
Not only are the qualifiers in line 6 formatted, but rather the whole line. Compare this to the result of formatting without the `QualifierAlignment` option:
```
> clang-format test.cpp -lines=2:2 -style="{Language: Cpp}"
// test.cpp
void foo(const int &value) {
// do something
}
void bar(const int& value){
// do another thing
}
```
This is using clang-format version 14.0.0, obtained from the LLVM releases page.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1lE1vnDAQhn8NXEYg1kDYPXBIsskprdSqas8GBnBrbGqbTfffdwxsPtpEyqqpZAH-epl53rEr3RzLbz0qmKxQHbgeIbhIPk1cilaguZSiUwMqR4OgRye0Ctg11JKrLmq1GbgDWqEN2nlvrYeBqwakUAgjN3xAh8ZLRn7I0kccJPsguVyeN7_4MEoM0rVP82tbuuyWGji0Lq7HcRk8aNFAq3XAtrVWlgKg8NgFHLicMGC7oLhaFgKs-xsNVlMkPaW4Chf7p2HMkhU3Z0lypSllAy_K_pHH_PzSCwtEapLO0h9eXpnePKd7yh1WgOmeES0GkXVHD24fMEbh3dGWiXeeJFwTKTLpBRNp8rPoeufjpG1vYkwoYIFCRE5A4N8gn6F5NuWP2oFW8gjc4FyTP08cPPSlMi9goeuw8aSqyYHh628Q7nstcV4Yw7UexkWIvHN6nl8sBN2eVPzJuReu16TzlhP0WrW_k_dnmPtQ7e9o7n85QfPZobZcU88oHchZogqbLE7ixPupK8cJGCVp9DA7cnf39QP5JpFbuqlGghWHTZk2u3THQyecxDLIr57KBvn-tdtscWO99xoql4fr82_Xw8nIsndutN71OfOOKmWqYhKnjpSH0ysajf6ONWG7FdZO5De7zbPtdhv2ZZs1VdYyrIp6WzPctVVb4KbYVbjJNjnjoeQVSuuTIO8V3sMs4esg34eiZAljSbZJkyJLcha32bbd8S0vqjRNOOZBluDAhYx9HLE2XWjKOaRq6ixNSmGdfZzk1lJ6ODPz-nyi2jflcIwUIYqEjbg0yJtj5PgPVOEcSznn8hvJrfkI">