Skip to content

Clang-tidy: False positive readability-redundant-inline-specifier on out-of-line explicitly defaulted constructors #130745

@Eisenwave

Description

@Eisenwave

https://godbolt.org/z/Eqf1Er9M5

struct awoo {
    ~awoo();
};

inline awoo::~awoo() = default;
<source>:5:1: warning: function '~awoo' has inline specifier but is implicitly inlined [readability-redundant-inline-specifier]
    5 | inline awoo::~awoo() = default;
      | ^~~~~~
1 warning generated.

This warning is wrong: https://eel.is/c++draft/dcl.fct.def.default#3

The out-of-line explicitly-defaulted definition is not the first declaration, so it is not implicitly inline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions