clang-format: Setting to control C++ attributes #54265
Closed
Description
opened on Mar 8, 2022
See https://stackoverflow.com/questions/45740466/clang-format-setting-to-control-c-attributes
If we have e.g.
template <typename TChar>
[[gnu::always_inline]]
static ptr<TChar> within_limit(ptr<TChar> first, ptr<TChar> last);
template <typename TChar, typename FApply, typename... FApplyRest>
[[gnu::always_inline]]
static ptr<TChar> overflow(ptr<TChar> first, ptr<TChar> last, const FApply& apply, const FApplyRest&... apply_rest);
No matter how we tweak clang-format, the output is always something like this:
[[gnu::always_inline]] static ptr<TChar> within_limit(ptr<TChar> first, ptr<TChar> last);
[[gnu::always_inline]] static ptr<TChar>
overflow(ptr<TChar> first, ptr<TChar> last, const FApply& apply, const FApplyRest&... apply_rest);
There should be a way to configure clang-format not to move the attributes like that, as it complicates readability.
Activity