Clang-format and arguments in a function declaration

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Clang-format and arguments in a function declaration

Richard Smith via cfe-dev
Friends, a clang-format question: configured per [1], specifically
with `AlignConsecutiveDeclarations` set to true, clang-format version
6.0.0 (tags/google/stable/2017-11-14) outputs the following code:

template< class T1, class T2 >
PlaneAardvarks< T1, T2 >::PlaneAardvarksTask::PlaneAardvarksTask(
PlaneAardvarks< T1, T2 > *        super,

const EventualizedPlanesGo< T1 > &p,

Plane< T2 > &plane, std::size_t planeStart,

std::size_t planeStop )

(Apologies if the long lines wrap in your email reader—I've included a
copy of the code at [2].)

Although I asked for alignment of consecutive declarations, I was
quite surprised to see clang-format aligning arguments (with access
modifiers!) of a templated function definition: see the spaces before
`super` to line up with `p`. I thought to ask if this was intended
behavior, or could it be that function argument lists are being
accidentally treated as declarations?

Many thanks,



cfe-dev mailing list
[hidden email]