================
@@ -0,0 +1,21 @@
+// RUN: %clang_analyze_cc1 -std=c++23 %s -verify 
-analyzer-checker=alpha.cplusplus.InvalidatedIterator -analyzer-config 
aggressive-binary-operation-simplification=true
+
+// expected-no-diagnostics
+
+class ExplicitThis {
+  int f = 0;
+public:
+  ExplicitThis();
+  ExplicitThis(ExplicitThis& other);
+
+  ExplicitThis& operator=(this ExplicitThis& self, ExplicitThis const& other) 
{ // no crash
+    self.f = other.f;
+    return self;
+  }
+
+  ~ExplicitThis();
+};
+
+void func(ExplicitThis& obj1) {
+    obj1 = obj1;
+}
----------------
flovent wrote:

Moved to `invalidated-iterator.cpp`(its original testfile)

https://github.com/llvm/llvm-project/pull/132581
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to