Take this C++ code:
nonstd::optional<QueueLoader::CategorizedDownloads>
QueueLoader::categorize_downloads(
const std::vector<Download>& downloads,
bool also_remove_finished)
{
}
It's formatted weirdly just to make it clear what changes AStyle performs.
After running astyle --attach-return-type --max-code-length=80 reproducer.cpp:
nonstd::optional<QueueLoader::CategorizedDownloads> QueueLoader::categorize_downloads(
const std::vector<Download>& downloads,
bool also_remove_finished)
{
}
Note that the first line is now longer than 80 characters — longer than the limit we imposed.
After running the same command again:
nonstd::optional<QueueLoader::CategorizedDownloads>
QueueLoader::categorize_downloads(
const std::vector<Download>& downloads,
bool also_remove_finished)
{
}
AStyle corrected the line length, good! But if I run AStyle again, it applies attach-return-type once more and the code is back to its previous form. Running AStyle again and again makes the code switch back and forth between the two versions.
This issue was resolved in the latest 3.2 beta release.
Thanks!