[cfe-dev] strange clang-format of long return types

Kal b17c0de at gmail.com
Tue May 12 07:02:58 PDT 2015


When formatting long return types, newer versions of clang-format seem 
to do something strange. What used to be formatted like:

template <typename Ty>
inline typename std::enable_if<std::is_floating_point<Ty>::value,
                                Vec2<Ty>>::type
VectorNormalize(const Vec2<Ty>& V) {

Now gets formatted like:

template <typename Ty>
inline
     typename std::enable_if<std::is_floating_point<Ty>::value, 
Vec2<Ty>>::type
     VectorNormalize(const Vec2<Ty>& V) {

It seems strange to have the function name indented like that. Is there 
an option to control this soft of thing directly? Im using the following 
options with clang-format 3.6.0:

---
BasedOnStyle: Chromium
AccessModifierOffset: -2
Standard: Cpp11
BinPackParameters: true
ColumnLimit: 80
IndentWidth: 2
AllowShortFunctionsOnASingleLine: Inline
AlwaysBreakTemplateDeclarations: true
Cpp11BracedListStyle: true
PointerAlignment: Left
SpacesBeforeTrailingComments: 1
...




More information about the cfe-dev mailing list