Issue 176623
Summary [bug][clang-tidy][21.1.8] A false positive case of the rule readability-non-const-parameter
Labels clang-tidy, false-positive
Assignees
Reporter yaoxinliu
    ```
template<bool>
class A final {
    char* sz_ = {};

public:
    constexpr explicit A(char* const sz) noexcept : sz_(sz) {
    }

    [[nodiscard]] bool ok() const {
        return sz_;
    }
};

int main() {
    // clang-tidy warning of readability-non-const-parameter: Pointer parameter 'p' can be pointer to const. 
    auto const _ = []<auto tc>(char* const p) { auto _ = A<tc>(p); }; 
}
```

The clang-tidy warning is false positive.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to