================
@@ -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;
+}
----------------
steakhal wrote:
Can we put this into the file testing `InvalidatedIterator` and have wrap this
into a namespace `GH116372`?
This is an experimental (and crashing) checker. I don't think it deserves a
dedicated test file.
https://github.com/llvm/llvm-project/pull/132581
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits