Skip to content

[clang-format] Unexpected formatting on function parameter #91771

@LinZhihao-723

Description

@LinZhihao-723

clang-format version: 18.1
Config file: https://github.com/LinZhihao-723/clp/blob/lint-update/components/core/.clang-format
Formatting output: https://github.com/LinZhihao-723/clp/blob/lint-update/components/core/src/clp/ir/LogEventDeserializer.cpp#L13
Formatted result:

template <typename encoded_variable_t>
auto LogEventDeserializer<encoded_variable_t>::create(ReaderInterface& reader
) -> BOOST_OUTCOME_V2_NAMESPACE::std_result<LogEventDeserializer<encoded_variable_t>> {

Expected result:

template <typename encoded_variable_t>
auto LogEventDeserializer<encoded_variable_t>::create(
        ReaderInterface& reader
) -> BOOST_OUTCOME_V2_NAMESPACE::std_result<LogEventDeserializer<encoded_variable_t>> {

Result from clang-format 17:

template <typename encoded_variable_t>
auto LogEventDeserializer<encoded_variable_t>::create(ReaderInterface& reader)
        -> BOOST_OUTCOME_V2_NAMESPACE::std_result<LogEventDeserializer<encoded_variable_t>> {

Not sure if this is a bug or missing configuration in .clang-format. Would be appreciated if someone can help take a look :D

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions