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

Daniel Jasper djasper at google.com
Tue May 12 08:03:32 PDT 2015


Feel free to file a bug for this on llvm.org/bugs (component should be the
Formatter).

I think we are misinterpreting the "inline" as part of the type, which we
shouldn't.

That being said, you might not need "inline" here...

On Tue, May 12, 2015 at 4:02 PM, Kal <b17c0de at gmail.com> wrote:

> 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
> ...
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150512/ef74127f/attachment.html>


More information about the cfe-dev mailing list