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

Jon Chesterfield 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:

```cpp
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,

Ahmed

[1] https://gist.github.com/fasiha/a86678bd2483a4d69b06d1790afe2d42

[2] https://gist.github.com/fasiha/a86678bd2483a4d69b06d1790afe2d42#file-plane-h
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev