================
@@ -219,3 +219,20 @@ namespace PR33759 {
static Number& getNumber();
};
}
+
+namespace PR54276 {
+
+ class PrivateDeletedFunctionWithPublicOverload {
+ public:
+ void foo() {}
+ private:
+ void foo(int) = delete;
+ // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: deleted member function
should be public [modernize-use-equals-delete]
+ };
+
+ class PrivateDeletedFunctionWithPrivateOverload {
+ private:
+ void foo() {}
+ void foo(int) = delete;
+ };
+}
----------------
localspook wrote:
Can we add tests with templates? For example, a positive test:
```cpp
class A {
public:
template <typename T>
void foo(T) {}
private:
template <typename T>
void foo(T *) = delete; // should warn
};
```
and a negative test:
```cpp
class A {
private:
template <typename T>
void foo(T) {}
template <typename T>
void foo(T *) = delete;
};
```
https://github.com/llvm/llvm-project/pull/182577
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits