Issue 180362
Summary [clang-tidy] false positive on cppcoreguidelines-missing-std-forward with constrained templates
Labels clang-tidy, false-positive
Assignees
Reporter rdong8
    ```cpp
#include <concepts>

class A
{
public:
    template <std::derived_from<A> Self>
 auto operator|(this Self &&self, int) -> void {}
};

auto main() -> int
{
    A a;
    a | 1;
}
```

`Self` is a regular rvalue reference and not a forwarding reference in `A::operator|` because of the constraint (and as seen by the compiler error in `main`), but clang-tidy will still warn [cppcoreguidelines-missing-std-forward](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/missing-std-forward.html) on this.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to