<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/unittests/Format/FormatTestSelective.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[clang-format][NFC] Clean up around StringRef initializations (#149765)</title>
<updated>2025-07-22T02:11:17+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2025-07-22T02:11:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4d48996ff05305d4a5774f3e232c2ee4a06c3d2a'/>
<id>4d48996ff05305d4a5774f3e232c2ee4a06c3d2a</id>
<content type='text'>
Consistently use `constexpr StringRef Code("string literal");`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Consistently use `constexpr StringRef Code("string literal");`.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format][NFC] Delete redundant type names after FormatStyle::</title>
<updated>2025-07-21T03:27:37+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2025-07-21T03:15:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f3a3270dbca3649b7d56aaa42cb8481fb34e2d67'/>
<id>f3a3270dbca3649b7d56aaa42cb8481fb34e2d67</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Propagate `LeadingEmptyLinesAffected` when joining lines (#146761)</title>
<updated>2025-07-05T21:06:59+00:00</updated>
<author>
<name>Eric Li</name>
<email>li.zhe.hua@gmail.com</email>
</author>
<published>2025-07-05T21:06:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=878ce210e30f8ebcb4b73d834f91229a403e2376'/>
<id>878ce210e30f8ebcb4b73d834f91229a403e2376</id>
<content type='text'>
Before this commit, when `LineJoiner` joins a line with affected leading
whitespace, it would drop the knowledge of this entirely. However, when
the `AffectedRangeManager` is computing the affected lines, the leading
empty whitespace lines are potentially considered for non-first tokens
in the `AnnotatedLine`. This causes a discrepancy in behavior when an
`AnnotatedLine` is put together from joining multiple lines versus when
it is not.

We change `LineJoiner::join` to follow `AffectedRangeManager`'s logic,
considering the leading whitespace when determining `Affected` for a
token.


https://github.com/llvm/llvm-project/blob/a63f57262898588b576d66e5fd79c0aa64b35f2d/clang/lib/Format/AffectedRangeManager.cpp#L111-L130

Fixes #138942.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit, when `LineJoiner` joins a line with affected leading
whitespace, it would drop the knowledge of this entirely. However, when
the `AffectedRangeManager` is computing the affected lines, the leading
empty whitespace lines are potentially considered for non-first tokens
in the `AnnotatedLine`. This causes a discrepancy in behavior when an
`AnnotatedLine` is put together from joining multiple lines versus when
it is not.

We change `LineJoiner::join` to follow `AffectedRangeManager`'s logic,
considering the leading whitespace when determining `Affected` for a
token.


https://github.com/llvm/llvm-project/blob/a63f57262898588b576d66e5fd79c0aa64b35f2d/clang/lib/Format/AffectedRangeManager.cpp#L111-L130

Fixes #138942.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Stop fixing indentation on namespace closing brace (#122234)</title>
<updated>2025-01-10T03:10:15+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2025-01-10T03:10:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2ea34cdf2ba86cd129633f2a01fb695c79c0fe11'/>
<id>2ea34cdf2ba86cd129633f2a01fb695c79c0fe11</id>
<content type='text'>
Fixes #119790.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #119790.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format][NFC] Remove redundnat llvm::, clang::, etc.</title>
<updated>2024-05-21T03:32:18+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2024-05-21T02:28:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1c58208d899285318c89e069268145c85ec33368'/>
<id>1c58208d899285318c89e069268145c85ec33368</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format][NFC] Remove more extraneous newlines in unit tests</title>
<updated>2023-10-27T09:22:36+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2023-10-27T09:17:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6c3bc910588f962e49470098ccc3b13c29cae493'/>
<id>6c3bc910588f962e49470098ccc3b13c29cae493</id>
<content type='text'>
Also removed a duplicate test case.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also removed a duplicate test case.
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Fix indent for selective formatting</title>
<updated>2023-07-18T21:10:53+00:00</updated>
<author>
<name>Sedenion</name>
<email>39583823+Sedeniono@users.noreply.github.com</email>
</author>
<published>2023-07-18T20:39:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0570cc568f5c8047267be7ab5056f8c4f45349b5'/>
<id>0570cc568f5c8047267be7ab5056f8c4f45349b5</id>
<content type='text'>
The problem was that the LevelIndentTracker remembered
the indentation level of previous deeper levels when
leaving a scope. Afterwards, when it entered again a
deeper level, it blindly reused the previous
indentation level. In case the --lines option was used
such that the previous deeper level was not formatted,
that previous level was whatever happened to be there
in the source code. The formatter simply believed it.

This is fixed by letting the LevelIndentTracker forget
the previous deeper levels when stepping out of them
(=&gt; change in LevelIndentTracker::nextLine()).
Note that this used to be the case until LLVM 14.0.6,
but was changed in https://reviews.llvm.org/D129064
(#56352) to fix a crash. Our commit here essentially
reverts that crash fix. It was incorrect/incomplete.

Fixes #58464.
Fixes #59178.
Fixes #62799.

Differential Revision: https://reviews.llvm.org/D151047
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The problem was that the LevelIndentTracker remembered
the indentation level of previous deeper levels when
leaving a scope. Afterwards, when it entered again a
deeper level, it blindly reused the previous
indentation level. In case the --lines option was used
such that the previous deeper level was not formatted,
that previous level was whatever happened to be there
in the source code. The formatter simply believed it.

This is fixed by letting the LevelIndentTracker forget
the previous deeper levels when stepping out of them
(=&gt; change in LevelIndentTracker::nextLine()).
Note that this used to be the case until LLVM 14.0.6,
but was changed in https://reviews.llvm.org/D129064
(#56352) to fix a crash. Our commit here essentially
reverts that crash fix. It was incorrect/incomplete.

Fixes #58464.
Fixes #59178.
Fixes #62799.

Differential Revision: https://reviews.llvm.org/D151047
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[clang-format] Fix indentation for selective formatting"</title>
<updated>2023-05-24T05:18:13+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2023-05-24T05:11:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8e16365cb6162a29a2a8d26f2d5f0081a651d73a'/>
<id>8e16365cb6162a29a2a8d26f2d5f0081a651d73a</id>
<content type='text'>
This reverts commit 72ab89e3197cc1bee3b9774edb504690e3e43ed0.

Reverted due to bots failures e.g.
https://lab.llvm.org/buildbot/#/builders/139/builds/41339.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 72ab89e3197cc1bee3b9774edb504690e3e43ed0.

Reverted due to bots failures e.g.
https://lab.llvm.org/buildbot/#/builders/139/builds/41339.
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Fix indentation for selective formatting</title>
<updated>2023-05-24T02:40:24+00:00</updated>
<author>
<name>Sedenion</name>
<email>39583823+Sedeniono@users.noreply.github.com</email>
</author>
<published>2023-05-24T02:10:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=72ab89e3197cc1bee3b9774edb504690e3e43ed0'/>
<id>72ab89e3197cc1bee3b9774edb504690e3e43ed0</id>
<content type='text'>
The problem was that the LevelIndentTracker remembered
the indentation level of previous deeper levels when
leaving a scope. Afterwards, when it entered again a
deeper level, it blindly reused the the previous
indentation level. In case of the --lines option
configured such that the previous deeper level was not
formatted, that previous level was whatever happened
to be there in the source code. The formatter simply
believed it.

This is fixed by letting the LevelIndentTracker forget
the previous deeper levels when stepping out of them
(=&gt; change in LevelIndentTracker::nextLine()).
Note that this used to be the case until LLVM 14.0.6,
but was changed in
https://github.com/llvm/llvm-project/issues/56352 to
fix a crash. Our commit here essentially reverts that
crash fix. It seemed to have been incorrect. The proper
fix is to set the AnnotedLine::Level of joined lines
correctly (=&gt; change in LineJoiner::join()).

See
https://github.com/llvm/llvm-project/issues/59178#issuecomment-1542637781
for some more details.

Fixes #58464.
Fixes #59178.

Differential Revision: https://reviews.llvm.org/D151047
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The problem was that the LevelIndentTracker remembered
the indentation level of previous deeper levels when
leaving a scope. Afterwards, when it entered again a
deeper level, it blindly reused the the previous
indentation level. In case of the --lines option
configured such that the previous deeper level was not
formatted, that previous level was whatever happened
to be there in the source code. The formatter simply
believed it.

This is fixed by letting the LevelIndentTracker forget
the previous deeper levels when stepping out of them
(=&gt; change in LevelIndentTracker::nextLine()).
Note that this used to be the case until LLVM 14.0.6,
but was changed in
https://github.com/llvm/llvm-project/issues/56352 to
fix a crash. Our commit here essentially reverts that
crash fix. It seemed to have been incorrect. The proper
fix is to set the AnnotedLine::Level of joined lines
correctly (=&gt; change in LineJoiner::join()).

See
https://github.com/llvm/llvm-project/issues/59178#issuecomment-1542637781
for some more details.

Fixes #58464.
Fixes #59178.

Differential Revision: https://reviews.llvm.org/D151047
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Avoid crash in LevelIndentTracker.</title>
<updated>2022-07-07T08:15:45+00:00</updated>
<author>
<name>Marek Kurdej</name>
<email>marek.kurdej+llvm.org@gmail.com</email>
</author>
<published>2022-07-04T09:28:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=14c30c70c4595d8f410c74a72357a5a31fdd5507'/>
<id>14c30c70c4595d8f410c74a72357a5a31fdd5507</id>
<content type='text'>
Fixes https://github.com/llvm/llvm-project/issues/56352.

Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D129064
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes https://github.com/llvm/llvm-project/issues/56352.

Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D129064
</pre>
</div>
</content>
</entry>
</feed>
