Issue 143237
Summary [BUG|clang-tidy] false positive on misc-unconventional-assign-operator
Labels clang-tidy, false-positive
Assignees
Reporter yaoxinliu
    ```
struct A {
    explicit A(int) {
    }

    A& operator=(int n) {
        // ok, no clang-tidy warning.
        return *this = A(n); 
 }
};

template<typename T>
struct B {
    explicit B(int) {
    }

 B& operator=(int n) {
        // clang-tidy warning: Operator=() should always return '*this'
        // clang-tidy    rule: misc-unconventional-assign-operator
        return *this = B(n); 
 }
};
```

clang-tidy version: 20.1.5
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to