Issue 76159
Summary Inconsistent behavior of cppcoreguidelines-noexcept-move-operations
Labels clang-tidy, false-positive, false-negative
Assignees
Reporter carlosgalvezp
    Hi,

Consider this example:
https://godbolt.org/z/5zK9abTjz

```cpp
#include <fstream>

struct Data
{
    Data() = default;

 Data(Data&&)            = default;
    Data& operator=(Data&&) = default;

    Data(Data const&)            = delete;
    Data& operator=(Data const&) = delete;

    ~Data() { }

 private:
 std::ofstream file_{};
};
```
Here, clang-tidy warnings about the operations. However, if I remove the entire private section, then clang-tidy does not warn.

Honestly I don't know what the correct behavior should be. Personally I think all `= default` operations should probably not be warned about. 

Anyway, this warning should have a consistent behavior regardless of whether the struct has a private section or not.

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to