Menu

#590 astyle 3.6.8 (git 2025-03-14): incorrect using indentation

closed-fixed
None
2025-03-26
2025-03-14
Zenju
No

AStyle built from git 2025-03-14 code produces: (full repro when inside .cpp file)

template <typename... Ts>
struct is_proxy_type_list<ProxyTypeList<Ts...>> : std::true_type {};

template <typename T>
struct GenerateTypeList
{
private:
    using proxy = typename std::conditional<is_proxy_type_list<T>::value, T,
    ProxyTypeList<T>>::type;
};

The expected "using" indentation should be:

template <typename... Ts>
struct is_proxy_type_list<ProxyTypeList<Ts...>> : std::true_type {};

template <typename T>
struct GenerateTypeList
{
private:
    using proxy = typename std::conditional<is_proxy_type_list<T>::value, T,
                  ProxyTypeList<T>>::type;
};

using

--style=allman
--suffix=none
--keep-one-line-blocks
--align-pointer=type
--min-conditional-indent=0
--max-continuation-indent=80
--indent-switches
--indent-col1-comments
--indent-preproc-block
--indent-preproc-define
--pad-header
--pad-comma
--formatted
--lineend=linux
--indent-preproc-block
--convert-tabs
--preserve-ws

Discussion

  • André Simon

    André Simon - 2025-03-16
    • status: open --> open-accepted
    • assigned_to: André Simon
     
  • Zenju

    Zenju - 2025-03-21

    Thinking about it, the expected result is probably better this one:

    template <typename... Ts>
    struct is_proxy_type_list<ProxyTypeList<Ts...>> : std::true_type {};
    
    template <typename T>
    struct GenerateTypeList
    {
    private:
        using proxy = typename std::conditional<is_proxy_type_list<T>::value, T,
                          ProxyTypeList<T>>::type;
    };
    

    But with your latest changes, the current code produces:

    template <typename T>
    struct GenerateTypeList
    {
    private:
        using proxy = typename std::conditional<is_proxy_type_list<T>::value, T,
              ProxyTypeList<T>>::type;
    };
    

    which is reasonable. So this ticket can be closed! Thanks a lot for your efforts!

     
  • André Simon

    André Simon - 2025-03-26
    • status: open-accepted --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB